-
-
Notifications
You must be signed in to change notification settings - Fork 13.2k
util-linux: fix build, add LDFLAGS="-lm" on Linux #214529
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
Conversation
|
Bump. Review anyone? This has been here 2 weeks and my last attempt never got reviewed. |
|
The discussion linked has someone needing to add it to multiple formulae, so seems clear this is a toolchain problem instead and not a util-linux one. I wonder if we can slim this down - does a |
|
Thanks for looking. I'm out of my depth here, but happy to experiment if you can help. |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
|
Sorry forgot about this. I'm finishing a glibc update this weekend so will take a look at this with that. |
|
Thanks, Bo98. It won't get stale this time! So, I misread your question last time (forgot the homebrew's gcc fails like so: homebrew's gcc is not linked, and system gcc fails differently: Again, I don't know what that means, but I'm happy to mess with it. |
|
Anything else I can do to help with this? |
|
Haven't quite gotten round to looking at glibc yet since patchelf fixes took longer than expected but does Homebrew GCC work if you can get it to use Homebrew binutils too rather than |
|
I think NB: Homebrew GCC has updated since the last test: Baseline: same failure as before: With brewed |
|
I got it to upgrade by manually adding I'm clueless with build chains and compiler flags, but happy to try stuff. Here's a gist of my most recent failure, pursuant to some interesting thoughts from @cho-m. |
Formula/u/util-linux.rb
Outdated
|
|
||
| system "./configure", *args, *std_configure_args | ||
| system "make", "install" | ||
| system "make", "install", "LDFLAGS=\"-lm\"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| system "make", "install", "LDFLAGS=\"-lm\"" | |
| ENV.append "LDFLAGS", "-lm" if OS.linux? | |
| system "make", "install" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed. GH's suggested commit message didn't match HB style. Tried to fix it but failed check didn't clear. Hope I didn't mess it up too badly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dang, I should have tested! –famous last words
It turns out that command line arg variables can override the Makefile, but environment variables can't. I learned a lot and wrote it all up in the discussion. I'd appreciate your input.
set LDFLAGS conditionally on Linux Homebrew#214529 (comment) Co-authored-by: Carlo Cabrera <github@carlo.cab>
Homebrew#214529 (comment) Co-authored-by: Carlo Cabrera <github@carlo.cab>
|
I can't push to your fork; can you squash your commits together so we can merge this? |
https://github.com/orgs/Homebrew/discussions/5421#discussioncomment-10578716 Homebrew#214529 (comment) Co-authored-by: Carlo Cabrera <github@carlo.cab>
Sorry. It's because I organize my forks under an org: isaacs/github#1681, Anyway, squashed. |
This was attempted in Homebrew#214529, but not actually fixed. This changes the approach from an environment variable to a `make` command argument. Full explanation in discussion: https://github.com/orgs/Homebrew/discussions/5421#discussioncomment-14260165 Closes https://github.com/orgs/Homebrew/discussions/5421
|
My root-cause analysis and possible general fix (for brew binutils + brew glibc) at Still deciding if this should be handled in Homebrew/brew instead via |
This was attempted in Homebrew#214529, but not actually fixed. This changes the approach from an environment variable to a `make` command argument. Full explanation in discussion: https://github.com/orgs/Homebrew/discussions/5421#discussioncomment-14260165 Closes https://github.com/orgs/Homebrew/discussions/5421 Co-authored-by: Carlo Cabrera <github@carlo.cab>
This was attempted in Homebrew#214529, but not actually fixed. This changes the approach from an environment variable to a `make` command argument. Full explanation in discussion: https://github.com/orgs/Homebrew/discussions/5421#discussioncomment-14260165 Closes https://github.com/orgs/Homebrew/discussions/5421 Co-authored-by: Carlo Cabrera <github@carlo.cab>
This fixes (on my machine) the build failure I reported in discussion #5421. It wasn't linking
libmand now it does, withLDFLAGS="-LM", as suggested by @eviatarbach.It built on the weird CentOS 7 machine where I encountered the error, and it built and tested fine on my normal WSL Ubuntu instance.
I previously tried this in #204576 and it didn't get any attention. I still believe it's needed.
HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where<formula>is the name of the formula you're submitting?brew test <formula>, where<formula>is the name of the formula you're submitting?brew audit --strict <formula>(after doingHOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it passbrew audit --new <formula>?Install & test results