-
Notifications
You must be signed in to change notification settings - Fork 128
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
Fix linking on Debian Stretch (gcc-6) #118
Fix linking on Debian Stretch (gcc-6) #118
Conversation
Provide cc-option. Use that to check if -no-pie is available and append it when necessary. Signed-off-by: Wei Liu <[email protected]>
Would passing no-pie via [ACL]*FLAGS to buildrump.sh work? That's how other permanent toolchain flags are set. |
Using ACLFLAGS doesn't work because it appears to pass the flag directly to the underlying cc1 which causes the error: |
Tracking it down further, it's because |
If it's a linker-only flag, use only LFLAGS. |
or LDFLAGS. plus or minus some other obvious typos I make |
Also doesn't work. Did more experiments.
So on gcc-6+ configured with --enable-default-pie it seems like there isn't a way to link relocatable unless -no-pie is given to gcc before the specs file or linker arguments are parsed. |
It's then a good demonstration of why new ways to handle existing things can be bad for users ... Anyway, we can't fix underlying lossage, just work around it. I'd test for the condition only once in build-rr, though. I don't think the toolchain wrappers are supposed to handle the underlying toolchain changing, so testing at runtime is not necessary. |
So something like fbcc68f? |
I'd put the result into config.{mk,sh} instead of using export so that if someone runs make in the tree manually, the consistent thing happens. And, I'd use a more generic name like EXTRACCFLAGS (or a better name ;), so that other similar options don't need to be patched in many places. But, I'm just nitpicking, and by large, yes. Do you want push access to merge and maintain your patch? |
Ok and Ok. I'll update and flatten my commits. |
fbcc68f
to
0a4b25d
Compare
This builds upon the previous commit to add -no-pie anywhere the relocatable flag (-Wl,-r) is used to handle compilers that enable -pie by default (Such as Debian Stretch).
0a4b25d
to
b3c1033
Compare
Ok I'm ready for this to be merged if it is sufficient. |
If you're going to maintain it, I have no objections ;-) thanks! |
Sure, I can maintain it in the future. |
thanks again |
This continues on top of #100 which was closed.
I've had this sitting around for a while. Not sure if it is appropriate for merging.
This should fix: #85, #99, #102 and #113 (Or at least advance)
Tagging @liuw because I'm reusing one of your commits and unsure you will get notified.