Skip to content

default.yaml: use linker flag --hash-style just if we are in a gnu toolchain#84

Merged
jkloetzke merged 2 commits into
BobBuildTool:masterfrom
mahaase:bugfix/gnulinkerflags
May 31, 2021
Merged

default.yaml: use linker flag --hash-style just if we are in a gnu toolchain#84
jkloetzke merged 2 commits into
BobBuildTool:masterfrom
mahaase:bugfix/gnulinkerflags

Conversation

@mahaase
Copy link
Copy Markdown
Contributor

@mahaase mahaase commented Mar 29, 2021

.FIXES #83

@jkloetzke
Copy link
Copy Markdown
Member

I think the proper test is to compare BOB_HOST_PLATFORM to linux. This option is just an optimization and I'm not sure if it's even needed anymore nowadays.

@mahaase mahaase force-pushed the bugfix/gnulinkerflags branch 2 times, most recently from 1567c67 to 851f608 Compare May 6, 2021 12:19
@mahaase
Copy link
Copy Markdown
Contributor Author

mahaase commented May 6, 2021

thx for review. reworked.

@jkloetzke
Copy link
Copy Markdown
Member

Except for the commit message (No ".FIXES"; The "Fixes #...." should be on a separate line) its ok.

But I've looked deeper into it and it looks like the optimized linker hash is still not the default. Could you please add a 2nd commit that adds --with-linker-hash-style=gnu to buildGcc() in recipes/devel/gcc.yaml and see if this still builds? That should make the gnu hash style the default and we can safely remove the switch form CFLAGS.

@mahaase mahaase force-pushed the bugfix/gnulinkerflags branch from 851f608 to 31b50e2 Compare May 10, 2021 06:08
@mahaase
Copy link
Copy Markdown
Contributor Author

mahaase commented May 10, 2021

now the difference is, that the optimization (maybe) isn't there, if a build with host-gcc will be started..
fine for me!

@mahaase mahaase force-pushed the bugfix/gnulinkerflags branch from 31b50e2 to 383224a Compare May 10, 2021 06:18
@jkloetzke
Copy link
Copy Markdown
Member

Oh, good point. I don't think that gcc 5.4 does support the configure switch yet so we probably cannot add --with-linker-hash-style=gnu in recipes/devel/compat/gcc.yaml. We could amend CFLAGS via provideVars, though.

BTW, now that we've switched the default hash style we can drop the remaining -Wl,--hash-style=gnu in the various recipes too...

@mahaase
Copy link
Copy Markdown
Contributor Author

mahaase commented May 11, 2021

soooo, couldn't we safely remove the default.yaml's linker-hash-style stuff, because

recipes/devel/compat/cross-toolchain.yaml
recipes/devel/cross-toolchain.yaml
recipes/devel/gcc.yaml

already provide the LDFLAGS? Maybe the --with-linker-hash-style=gnu isn't necessary.
The only thing, which is changed is, if somebody uses basement without the provilded toolchains, than the gcc-gnu-linker-hash-style isn't set be default.yaml. a good thing, if the user doesn't uses gcc ;-)

@mahaase
Copy link
Copy Markdown
Contributor Author

mahaase commented May 11, 2021

in devel/compat/gcc the target-toolchain doesn't provide environment at all. should we add this like in devel/gcc done?!

@mahaase mahaase force-pushed the bugfix/gnulinkerflags branch from 383224a to b2b0372 Compare May 11, 2021 06:36
@jkloetzke
Copy link
Copy Markdown
Member

Yes, we can remove the --hash-style= switch from all recipes. As replacement we must:

  • add --with-linker-hash-style=gnu to buildGcc() in recipes/devel/gcc.yaml. This will make it the default for all cross-compiling toolchains.
  • add the following at the end in recipes/devel/host-compat-toolchain.yaml to set the flag if the host compat toolchain is used:
    LDFLAGS: "$LDFLAGS  -Wl,--hash-style=gnu"

If the host compat toolchain is not used (BASEMENT_HOST_COMPAT_TOOLCHAIN== 0) then it's up to the project to either set the flag manually or build without the optimization (which is not a real problem).

Your change to recipes/devel/compat/gcc.yaml should be dropped. It only influences the build of libs::compat::glibc-dev which is not relevant here.

@mahaase
Copy link
Copy Markdown
Contributor Author

mahaase commented May 21, 2021

but this one is finished/fixed, isn't it?
from my side it is ready for reintegration.

@mahaase
Copy link
Copy Markdown
Contributor Author

mahaase commented May 31, 2021

ping.

@mahaase mahaase force-pushed the bugfix/gnulinkerflags branch from 2b2b7e5 to 34833c2 Compare May 31, 2021 11:57
@jkloetzke jkloetzke merged commit 7ab32f0 into BobBuildTool:master May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MSYS: unrecognized option '--hash-style=gnu'

2 participants