-
Notifications
You must be signed in to change notification settings - Fork 237
Android dynamic linker doesn't support DT_RPATH #598
Comments
Check out this wiki page: https://github.com/Linuxbrew/brew/wiki/Chromebook-Install-Instructions |
Wow. I had no idea that We use I'm surprised that Android OS doesn't support RPATH. Is that documented somewhere? |
Linuxbrew#598 disclaimer: i have no idea what i'm doing
Apologies for the wallotext. I got excited. @sjackman Thanks for the replies! I didn't notice them till now D: Could you advice me on the original question? How do I add an Android homebrew flavor that uses If I set up a github repo that, when run in circleci, allows you to ssh to Android, would you use it? It would take me several hours to get it running smoothly, but I don't mind. Although I personally have no opinion on RPATH vs RUNPATH, these are facts: All upstream maintainers prefer RUNPATH, and RPATH has been "deprecated" for ten years. Today, both Ubuntu and Arch compilers use RUNPATH by default, and of course the Android linker has no RPATH support. See also the patchelf default behavior. I believe their argument goes: LD_LIBRARY_PATH "should" be a user override for the linker, and RPATH was a design mistake. Given that bottles use RUNPATH already, is that sufficient to prove that using RUNPATH rather than RPATH works fine for both Linuxbrew and the wider Homebrew? IMHO it would be a smart choice from a future-proofing perspective, but again, I don't feel strongly. I just want Linuxbrew for Android! Re the Linuxbrew-chromebook wiki: It requires switching to dev mode which isn't an option for me, as I want to maintain corporate trust on this machine. |
For now, modify this code to add brew/Library/Homebrew/shims/linux/super/cc Line 258 in 8ccb999
As much as I'd like to say yes, I'm afraid that I don't have the time to take on this project myself. I'm happy to answer questions though.
I do understand the argument. For the purposes of Linuxbrew, however, I prefer
Feel free to update the Linuxbrew Wiki with instructions that do not require dev mode. That'd be quite useful I think to other Android users. |
Can do! :meseeks:
You'll have an easier time convincing the HPC maintainers to switch to the (demonstrably better) system of using --prefix or rpath than to reverse the rpath->runpath migration. Again, I don't myself have any opinion on the matter, but those are facts. I maintained the blas/lapack installation at ATI (AMD), and I did it using
This ticket is blocks such a thing from existing :D I'll do such when I get it working. |
Great!
I don't unfortunately have the time to convince each HPC admin to stop globally setting
I'm not sure what you mean by this exactly. Using
Since
Great! |
@sjackman continuing from this thread sadly i don't think it adds much to the investigation brew install -s hello || brew gist-logs hello
Updating Homebrew...
CANNOT LINK EXECUTABLE "/usr/bin/gcc-7": library "libandroid-support.so" not found
CANNOT LINK EXECUTABLE "/usr/bin/clang": library "libLLVM-5.0.so" not found
Error: hello cannot be built with any available compilers.
Install Clang or brew install gcc
Error: No logs. you were right, it was undoing my changes in i did notice that when i put a random println in near this patch, it never got printed, maybe there a different file i should be modifying or some other interaction in the ecosystem i'm not accounting for? |
Try… export HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_ENV_FILTERING=1 |
no dice 😢 but just as a sanity check, i put a is there maybe something upstream that's looking at the |
Try…
See brew/Library/Homebrew/extend/ENV.rb Lines 6 to 8 in 294f339
|
Yeah that seems right rb(main):002:0> superenv?
=> #<Pathname:/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/shims/linux/super> Maybe just the |
Check the files |
Same output from # UPDATE: output from `brew install -sd hello`
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/hello.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::AliasLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/perkeep.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb (Formulary::FromPathLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/hello.rb
CANNOT LINK EXECUTABLE "/usr/bin/gcc-7": library "libandroid-support.so" not found
CANNOT LINK EXECUTABLE "/usr/bin/clang": library "libLLVM-5.0.so" not found
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/llvm.rb
Error: hello cannot be built with any available compilers.
Install Clang or brew install gcc
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/compilers.rb:127:in `compiler'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/compilers.rb:109:in `select_for'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/ENV/shared.rb:176:in `compiler'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/ENV/super.rb:40:in `setup_build_environment'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb:85:in `install'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb:202:in `<main>' |
Use… export HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_ENV_FILTERING=1 and remove
|
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/hello.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::AliasLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/perkeep.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb (Formulary::FromPathLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/hello.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/binutils.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/make.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/python.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gcc.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/glibc.rb
==> Downloading https://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz
####################################################################################################################################### 100.0%
tar: gzip: Cannot exec: No such file or directory
tar: Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
Error: Failure while executing: tar xzf /home/.cache/Homebrew/hello-2.10.tar.gz
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils.rb:296:in `safe_system'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/download_strategy.rb:77:in `safe_system'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/download_strategy.rb:239:in `stage'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/resource.rb:115:in `block in unpack'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/fileutils.rb:14:in `block in mktemp'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/fileutils.rb:74:in `block in run'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/fileutils.rb:74:in `chdir'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/fileutils.rb:74:in `run'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/extend/fileutils.rb:13:in `mktemp'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/resource.rb:114:in `unpack'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/resource.rb:92:in `stage'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:1872:in `stage'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:1090:in `brew'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb:124:in `block in install'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils.rb:554:in `with_env'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb:121:in `install'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb:202:in `<main>' ... then Already downloaded: /home/.cache/Homebrew/hello-2.10.tar.gz
==> ./configure --disable-silent-rules --prefix=/data/data/com.termux/files/home/linuxbrew/.linuxbrew/Cellar/hello/2.10
Last 15 lines from /home/.cache/Homebrew/Logs/hello/01.configure:
configure: WARNING: unrecognized options: --disable-debug
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... no
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc-7
checking whether the C compiler works... no
configure: error: in `/usr/tmp/hello-20180215-3532-do4wrh/hello-2.10':
configure: error: C compiler cannot create executables
See `config.log' for more details
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/debrew.rb:11:in `raise'
FormulaUnavailableError: No available formula with the name "xorg"
1. raise
2. ignore
3. backtrace
4. irb
5. shell
Choose an action: (awaiting my input ... what do i do?!?) |
😂 |
Please report the output of… brew install -s hello
brew gist-logs hello |
https://gist.github.com/anonymous/b4b0ffe4cb58771ff4489ac0186a3c57 |
I was hoping that there'd be a useful error message in
https://gist.github.com/anonymous/b4b0ffe4cb58771ff4489ac0186a3c57#file-config-log-L71 I'd suggest starting an interactive Brew shell with I see that Termux sets
https://gist.github.com/anonymous/b4b0ffe4cb58771ff4489ac0186a3c57#file-00-doctor-out-L8 Try removing
|
You'll likely also have to add
|
good newsbad news
Your shell has been configured to use Homebrew's build environment;
this should help you build stuff. Notably though, the system versions of
gem and pip will ignore our configuration and insist on using the
environment they were built under (mostly). Sadly, scons will also
ignore our configuration.
When done, type `exit'.
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/shims/linux/super/git: line 88: which: command not found
zsh: segmentation fault news ?this might be relevant to it not finding termux-chroot "which which awk"
/data/data/com.termux/files/usr/bin/applets/which
/data/data/com.termux/files/usr/bin/applets/awk but the |
With Lines 67 to 69 in 80394bd
That should get you past
|
Total shot in the dark, but try… /system/bin/linker64 /data/data/com.termux/files/home/linuxbrew/.linuxbrew/bin/hello |
Segfaults as well 😭 |
Try…
|
https://gist.github.com/anonymous/6aee66948e494786a207a32551475402#file-01-configure-L35 Any chance there's a Termux package for Try…
|
there is a termux
or something of the like... |
|
brew install patchelf
https://gist.github.com/anonymous/3bd4a9255fd5c7be6f299ce768d69ee5#file-02-make-L10 |
brew install tree
https://gist.github.com/anonymous/d1a70ae4d526d679c24216c4ab37cb77#file-01-make-L14 |
Try…
|
Try…
|
well, as i was |
holy shit!emojify :astonished:
😲 less-holy 💩 |
Ehh. I wish I had noticed this thread going on. I've already fixed (or at least worked around) all this in my own studies. The only thing holding me back was the rpath issue above. I've lost the edits due to a chromebook powerwash (derp), but I'm sure I can reiterate them quickly. I'll start that today. |
Woo! I take my successes where I can get them. 🤩 |
@bukzor Great! |
https://gist.github.com/anonymous/dee80dfdd81ebbde80ae82afd8d0ae93#file-01-make-L7 |
There's some good tidbits over here:
I see there's also Clang as well as GCC 5. It's worth a shot too: |
I have |
@bukzor Which packages provides libc and its headers, and is it |
libc is shipped as part of "bionic", which is android's non-gnu libc. It's not packaged by termux. I've pushed up the edits I've made to my own homebrew to a termux-support branch, and wrote a document for my debugging process on that branch. |
Cool. Thanks, Buck! We're in the process of merging Linuxbrew/brew into Homebrew/brew. So Linuxbrew/brew won't merge patches that we don't think will be eventually accepted upstream into Homebrew/brew. Some of these patches could be merged upstream. If you open a PR, I can comment on which chunks I think could be merged upstream. Some of the issues could be handled by setting |
Great success: https://imgur.com/a/88G1J (I wasn't able to copy the text out of termux in a way that would paste to gist.) @sjackman: I saw that! Good luck! I hope that I can somehow make an android (or should it be named termux?) specialization which sets the necessary defaults. |
Nicely done! |
I got pstree working by installing
|
Termux could perhaps handle some of these idiosyncrasies by for example creating a symlink from libandroid-glob.so to libglob.so. |
I've been tinkering with getting Linuxbrew working under termux under Android under Chromebook. The final missing link is that the android linker has absolutely no support for rpath.
How would I go about instructing homebrew to use
--enable-new-dtags
when compiling for Android? This will cause it to create runpath entries, which the android linker does support.I would propose we do this (
--enable-new-dtags
) for all of homebrew, if I had any idea of whether it would work, or what the effect would be.The text was updated successfully, but these errors were encountered: