Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: modest Android improvements #17396

Merged
merged 2 commits into from Aug 24, 2020

Conversation

icota
Copy link
Contributor

@icota icota commented Nov 6, 2019

I've been trying to build for Android on different OSes/Gitian with varying success. Build system is quite the beast and sometimes it doesn't get it right. To make sure it does these three little tweaks make the Android build more robust:

  • disable D-Bus (Android doesn't support it and has its own way to trigger notifications)
  • don't flag -lpthread when linking Boost, Bionic has built-in support
  • add -static-libstdc++ to linker flags. This avoids having to bundle libc++_shared with CLI apps, still necessary with bitcoin-qt though (thanks Sjors)

I think these are small and fairly straightforward so I put them all into this one PR.

@DrahtBot
Copy link
Contributor

DrahtBot commented Nov 6, 2019

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

No conflicts as of last run.

@icota icota force-pushed the 2019-11-android-static-libstdc branch from 99cfcf9 to 1a9c7ab Compare November 7, 2019 08:34
build-aux/m4/ax_boost_thread.m4 Outdated Show resolved Hide resolved
build-aux/m4/bitcoin_qt.m4 Show resolved Hide resolved
configure.ac Outdated Show resolved Hide resolved
@icota icota force-pushed the 2019-11-android-static-libstdc branch 2 times, most recently from fc0d989 to 25088a2 Compare November 12, 2019 08:22
@greenaddress
Copy link
Contributor

Seems to improve some issues found on android but not all - on top of doing checks for "xlinux-android" it should also do checks for "xlinux-androideabi" otherwise you cut off armv7

I'm doing some testing on this, will report my findings

@greenaddress
Copy link
Contributor

@icota I can confirm that with xlinux-androideabi as well as xlinux-android all android ndk builds work fine for me/abcore - see https://github.com/greenaddress/bitcoin_ndk/blob/master/0001-android-patches-1bc9988993ee84bc814e5a7f33cc90f670a19f6a.patch

@icota
Copy link
Contributor Author

icota commented Dec 14, 2019

Thanks @greenaddress! In that case for the case statement we should probably use wildcard(s) to look for xlinux-android* or even *android*.

I'm not sure if the test "x$host_os" = "x... bits allow for wildcards, if not I'd convert them to use case since it's neater. I'll investigate.

@icota icota force-pushed the 2019-11-android-static-libstdc branch 2 times, most recently from ce5b8eb to dfdc8b3 Compare December 19, 2019 13:59
@icota
Copy link
Contributor Author

icota commented Dec 19, 2019

Rebased and in ax_boost_thread.m4 converted if test to case statements for easier matching of Android flavours.

@maflcko
Copy link
Member

maflcko commented Jun 21, 2020

Concept ACK

@fanquake
Copy link
Member

@icota If you'd like to move forward here, can you do the following. 77a347c and dfdc8b3 should be combined into a single commit, that is actually just pulling in the latest version of the macro from upstream (looks like all the changes you made have been upstreamed), with an appropriate commit message. See 9c5bef4 in #19558 for an example of what I mean. I also think you can squash the other two commits.

Android uses a different notification system and doesn't support D-Bus
@icota icota force-pushed the 2019-11-android-static-libstdc branch from dfdc8b3 to 83c8119 Compare August 16, 2020 16:24
@icota
Copy link
Contributor Author

icota commented Aug 16, 2020

Thanks @fanquake. I've rebased and done exactly that.

Did a test Android ARM64 full build which completed successfully. I ran a normal native build as well and it also completed without error.

@icota icota force-pushed the 2019-11-android-static-libstdc branch from e614f7d to 366913e Compare August 16, 2020 16:48
@DrahtBot
Copy link
Contributor

Guix builds

File commit 1bc8e8e
(master)
commit 87e946c
(master and this pull)
*-aarch64-linux-gnu-debug.tar.gz ba41f394f562c9ec... 6a84d624fb5325c2...
*-aarch64-linux-gnu.tar.gz 70d920e06497e77b... e719a87a710ea7d8...
*-arm-linux-gnueabihf-debug.tar.gz 1af0f9da257d8cdb... 3ade00e81b0dcfb9...
*-arm-linux-gnueabihf.tar.gz 4017f134a463404c... 44276d4fabc3c461...
*-riscv64-linux-gnu-debug.tar.gz ac6e7216502ab750... 5df0a7b338dad0ea...
*-riscv64-linux-gnu.tar.gz fded0f57f7a0fe6c... d4a6568e2209f187...
*-win-unsigned.tar.gz ee2b6e81325c9277... be7a04b47ab090df...
*-win64-debug.zip c27b3c9b14d2aa2f... f014c2e43caacafe...
*-win64-setup-unsigned.exe 8a09c5a88d0f5735... 1014bf550db2dd02...
*-win64.zip e7f5f963a6e490be... 7e34a9e2285a9838...
*-x86_64-linux-gnu-debug.tar.gz bb2303a5a9e2d901... 10a5e410f0b4920c...
*-x86_64-linux-gnu.tar.gz 6c0be417f285c32c... 8d0bc3db25fdb02a...
*.tar.gz 9e674ed0081c5f0b... 539d80986cc500f8...
guix_build.log 9d3c81b395c6f903... cdfbfd8fdb92fc1c...
guix_build.log.diff 7f4ee5f0b904ec89...

@fanquake
Copy link
Member

Thanks @fanquake. I've rebased and done exactly that.

@icota Thanks for following up, this looks good now. Just waiting for the gitian build.

@DrahtBot
Copy link
Contributor

Gitian builds

File commit e9b3012
(master)
commit 3ecb83d
(master and this pull)
bitcoin-core-linux-0.21-res.yml cea1ba265603d02f... b063b10aa1146450...
bitcoin-core-osx-0.21-res.yml 77d7884f6a574134... 0727d16ea478b325...
bitcoin-core-win-0.21-res.yml 0b0f6bbbd9a5c0ef... b9edd272fccc40d8...
*-aarch64-linux-gnu-debug.tar.gz 4ed42dd1dc70bea9... 82ad07fb63117104...
*-aarch64-linux-gnu.tar.gz 8a7a6ef9cccbae35... 7a6ab24abc2d47e3...
*-arm-linux-gnueabihf-debug.tar.gz e40e4858ee8bd4d1... 2b7f2ff41e079dc6...
*-arm-linux-gnueabihf.tar.gz 7ddca7cad75ef53b... 345a923bfdcdfea1...
*-osx-unsigned.dmg 79a2858ea685e8b0... 474dad4346a269b1...
*-osx64.tar.gz e77905a2f3abb599... 06e6e9636f1e4469...
*-riscv64-linux-gnu-debug.tar.gz 4ccc4f940f998b62... 19e77cc72ae822a7...
*-riscv64-linux-gnu.tar.gz 561c5ed7ebaf0ea5... 07de76fa08620940...
*-win64-debug.zip e0b30b67a2217a50... 9f91995acfe56f88...
*-win64-setup-unsigned.exe 3e5025cde6a4d3d5... 0e1405eabab12c0e...
*-win64.zip caee7761af12305b... 27209cf126ce030e...
*-x86_64-linux-gnu-debug.tar.gz 4036b1cb7c0177b0... 44559b8710ba0b5c...
*-x86_64-linux-gnu.tar.gz e15879353155c44c... a973eab824c42213...
*.tar.gz e8cbb99f0f9f02a0... 16e3beea8b965f08...
linux-build.log 43933168846d907b... d6d8a8da8a69b6f6...
osx-build.log f0d612ea7fbc1c07... ea58f0a1e6a1d8af...
win-build.log 54a3cd2d3d8f9dd4... 87458f9c85f65af9...
bitcoin-core-linux-0.21-res.yml.diff e383ffc9ce0af076...
bitcoin-core-osx-0.21-res.yml.diff a91b370f0b6f88d5...
bitcoin-core-win-0.21-res.yml.diff c327e8e5eacf6f25...
linux-build.log.diff 88a98fa52872a42a...
osx-build.log.diff cfe3b915ebc6f89f...
win-build.log.diff 7d7efd4912b1d6ba...

@practicalswift
Copy link
Contributor

Concept ACK

Copy link
Member

@fanquake fanquake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 366913e

@fanquake fanquake merged commit 7ce7f2b into bitcoin:master Aug 24, 2020
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Aug 24, 2020
366913e build: AX_BOOST_THREAD serial 33 (Igor Cota)
cf06811 build: disable D-Bus on Android by default (Igor Cota)

Pull request description:

  I've been trying to build for Android on different OSes/Gitian with varying success. Build system is quite the beast and sometimes it doesn't get it right. To make sure it does these three little tweaks make the Android build more robust:

  - disable D-Bus (Android doesn't support it and has its own way to trigger notifications)
  - don't flag `-lpthread` when linking Boost, [Bionic has built-in support](https://stackoverflow.com/questions/30801752/android-ndk-and-pthread)
  - ~~add `-static-libstdc++` to linker flags. This avoids having to bundle `libc++_shared` with CLI apps, still necessary with `bitcoin-qt` though (thanks Sjors)~~

  I think these are small and fairly straightforward so I put them all into this one PR.

ACKs for top commit:
  fanquake:
    ACK 366913e

Tree-SHA512: 31465fd228a5877c20aa2a05f98242d4eeb328b9b35bd1a7a3dcfb1ef51379d84053a81ade5a65436ffc1bc8ccd21f11ed0539eb10e827d182c0c04394629af0
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 27, 2021
366913e build: AX_BOOST_THREAD serial 33 (Igor Cota)
cf06811 build: disable D-Bus on Android by default (Igor Cota)

Pull request description:

  I've been trying to build for Android on different OSes/Gitian with varying success. Build system is quite the beast and sometimes it doesn't get it right. To make sure it does these three little tweaks make the Android build more robust:

  - disable D-Bus (Android doesn't support it and has its own way to trigger notifications)
  - don't flag `-lpthread` when linking Boost, [Bionic has built-in support](https://stackoverflow.com/questions/30801752/android-ndk-and-pthread)
  - ~~add `-static-libstdc++` to linker flags. This avoids having to bundle `libc++_shared` with CLI apps, still necessary with `bitcoin-qt` though (thanks Sjors)~~

  I think these are small and fairly straightforward so I put them all into this one PR.

ACKs for top commit:
  fanquake:
    ACK 366913e

Tree-SHA512: 31465fd228a5877c20aa2a05f98242d4eeb328b9b35bd1a7a3dcfb1ef51379d84053a81ade5a65436ffc1bc8ccd21f11ed0539eb10e827d182c0c04394629af0
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 28, 2021
366913e build: AX_BOOST_THREAD serial 33 (Igor Cota)
cf06811 build: disable D-Bus on Android by default (Igor Cota)

Pull request description:

  I've been trying to build for Android on different OSes/Gitian with varying success. Build system is quite the beast and sometimes it doesn't get it right. To make sure it does these three little tweaks make the Android build more robust:

  - disable D-Bus (Android doesn't support it and has its own way to trigger notifications)
  - don't flag `-lpthread` when linking Boost, [Bionic has built-in support](https://stackoverflow.com/questions/30801752/android-ndk-and-pthread)
  - ~~add `-static-libstdc++` to linker flags. This avoids having to bundle `libc++_shared` with CLI apps, still necessary with `bitcoin-qt` though (thanks Sjors)~~

  I think these are small and fairly straightforward so I put them all into this one PR.

ACKs for top commit:
  fanquake:
    ACK 366913e

Tree-SHA512: 31465fd228a5877c20aa2a05f98242d4eeb328b9b35bd1a7a3dcfb1ef51379d84053a81ade5a65436ffc1bc8ccd21f11ed0539eb10e827d182c0c04394629af0
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jun 29, 2021
366913e build: AX_BOOST_THREAD serial 33 (Igor Cota)
cf06811 build: disable D-Bus on Android by default (Igor Cota)

Pull request description:

  I've been trying to build for Android on different OSes/Gitian with varying success. Build system is quite the beast and sometimes it doesn't get it right. To make sure it does these three little tweaks make the Android build more robust:

  - disable D-Bus (Android doesn't support it and has its own way to trigger notifications)
  - don't flag `-lpthread` when linking Boost, [Bionic has built-in support](https://stackoverflow.com/questions/30801752/android-ndk-and-pthread)
  - ~~add `-static-libstdc++` to linker flags. This avoids having to bundle `libc++_shared` with CLI apps, still necessary with `bitcoin-qt` though (thanks Sjors)~~

  I think these are small and fairly straightforward so I put them all into this one PR.

ACKs for top commit:
  fanquake:
    ACK 366913e

Tree-SHA512: 31465fd228a5877c20aa2a05f98242d4eeb328b9b35bd1a7a3dcfb1ef51379d84053a81ade5a65436ffc1bc8ccd21f11ed0539eb10e827d182c0c04394629af0
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 1, 2021
366913e build: AX_BOOST_THREAD serial 33 (Igor Cota)
cf06811 build: disable D-Bus on Android by default (Igor Cota)

Pull request description:

  I've been trying to build for Android on different OSes/Gitian with varying success. Build system is quite the beast and sometimes it doesn't get it right. To make sure it does these three little tweaks make the Android build more robust:

  - disable D-Bus (Android doesn't support it and has its own way to trigger notifications)
  - don't flag `-lpthread` when linking Boost, [Bionic has built-in support](https://stackoverflow.com/questions/30801752/android-ndk-and-pthread)
  - ~~add `-static-libstdc++` to linker flags. This avoids having to bundle `libc++_shared` with CLI apps, still necessary with `bitcoin-qt` though (thanks Sjors)~~

  I think these are small and fairly straightforward so I put them all into this one PR.

ACKs for top commit:
  fanquake:
    ACK 366913e

Tree-SHA512: 31465fd228a5877c20aa2a05f98242d4eeb328b9b35bd1a7a3dcfb1ef51379d84053a81ade5a65436ffc1bc8ccd21f11ed0539eb10e827d182c0c04394629af0
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 1, 2021
366913e build: AX_BOOST_THREAD serial 33 (Igor Cota)
cf06811 build: disable D-Bus on Android by default (Igor Cota)

Pull request description:

  I've been trying to build for Android on different OSes/Gitian with varying success. Build system is quite the beast and sometimes it doesn't get it right. To make sure it does these three little tweaks make the Android build more robust:

  - disable D-Bus (Android doesn't support it and has its own way to trigger notifications)
  - don't flag `-lpthread` when linking Boost, [Bionic has built-in support](https://stackoverflow.com/questions/30801752/android-ndk-and-pthread)
  - ~~add `-static-libstdc++` to linker flags. This avoids having to bundle `libc++_shared` with CLI apps, still necessary with `bitcoin-qt` though (thanks Sjors)~~

  I think these are small and fairly straightforward so I put them all into this one PR.

ACKs for top commit:
  fanquake:
    ACK 366913e

Tree-SHA512: 31465fd228a5877c20aa2a05f98242d4eeb328b9b35bd1a7a3dcfb1ef51379d84053a81ade5a65436ffc1bc8ccd21f11ed0539eb10e827d182c0c04394629af0
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 15, 2021
366913e build: AX_BOOST_THREAD serial 33 (Igor Cota)
cf06811 build: disable D-Bus on Android by default (Igor Cota)

Pull request description:

  I've been trying to build for Android on different OSes/Gitian with varying success. Build system is quite the beast and sometimes it doesn't get it right. To make sure it does these three little tweaks make the Android build more robust:

  - disable D-Bus (Android doesn't support it and has its own way to trigger notifications)
  - don't flag `-lpthread` when linking Boost, [Bionic has built-in support](https://stackoverflow.com/questions/30801752/android-ndk-and-pthread)
  - ~~add `-static-libstdc++` to linker flags. This avoids having to bundle `libc++_shared` with CLI apps, still necessary with `bitcoin-qt` though (thanks Sjors)~~

  I think these are small and fairly straightforward so I put them all into this one PR.

ACKs for top commit:
  fanquake:
    ACK 366913e

Tree-SHA512: 31465fd228a5877c20aa2a05f98242d4eeb328b9b35bd1a7a3dcfb1ef51379d84053a81ade5a65436ffc1bc8ccd21f11ed0539eb10e827d182c0c04394629af0
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 16, 2021
366913e build: AX_BOOST_THREAD serial 33 (Igor Cota)
cf06811 build: disable D-Bus on Android by default (Igor Cota)

Pull request description:

  I've been trying to build for Android on different OSes/Gitian with varying success. Build system is quite the beast and sometimes it doesn't get it right. To make sure it does these three little tweaks make the Android build more robust:

  - disable D-Bus (Android doesn't support it and has its own way to trigger notifications)
  - don't flag `-lpthread` when linking Boost, [Bionic has built-in support](https://stackoverflow.com/questions/30801752/android-ndk-and-pthread)
  - ~~add `-static-libstdc++` to linker flags. This avoids having to bundle `libc++_shared` with CLI apps, still necessary with `bitcoin-qt` though (thanks Sjors)~~

  I think these are small and fairly straightforward so I put them all into this one PR.

ACKs for top commit:
  fanquake:
    ACK 366913e

Tree-SHA512: 31465fd228a5877c20aa2a05f98242d4eeb328b9b35bd1a7a3dcfb1ef51379d84053a81ade5a65436ffc1bc8ccd21f11ed0539eb10e827d182c0c04394629af0
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants