Re: [PATCH] Use GCC_PICFLAG to collect host-specific PICFLAG from ../config/picflag.m4
On Wed, Jun 10, 2020 at 04:27:27PM -0600, Jeff Law wrote: > On Mon, 2019-07-22 at 12:39 -0400, Arvind Sankar wrote: > > The gcc configure script does not use the config/picflag.m4 macro to > > customize PICFLAG according to the host when using --enable-host-shared. > > > > Fix configure.ac to do so. > > > > Tested bootstrap on x86_64-linux-gnu. > > > > 2019-07-22 Arvind Sankar > > > > * gcc/configure.ac: Use GCC_PICFLAG. > I know this is old > > Can you be more specific here about what you're trying to fix? ie, what > host/target combination are you working on. What behavior are you seeing > (presumably usage of -fPIC) what behavior did you expect (some other flag > presumably). > > From looking at picflag.m4 the thing I worry the most about is the various > ix86/x86_64 clauses which specify -fpic. It looks like your change would > cause > us to start using -fpic rather than -fPIC as we've been doing for eons and I > worry that might have unintended consequences. > > Thanks, > Jeff > > > I don't remember exactly, but I don't think there was any actual problem. At the time, I was playing around with trying to build the bulk of cc1 etc as a shared library to reduce the size of the compiler installation. IIRC I just came across this, noticed that there's a config/picflag.m4 which wasn't getting used and posted this as a cleanup. This was originally added in r177967 ("Centralize PICFLAG configuration") which used it for PICFLAG_FOR_TARGET (which still goes via config/picflag.m4) but the host code which was added later just hardcodes -fPIC.
Re: [PATCH] Use GCC_PICFLAG to collect host-specific PICFLAG from ../config/picflag.m4
On Mon, 2019-07-22 at 12:39 -0400, Arvind Sankar wrote: > The gcc configure script does not use the config/picflag.m4 macro to > customize PICFLAG according to the host when using --enable-host-shared. > > Fix configure.ac to do so. > > Tested bootstrap on x86_64-linux-gnu. > > 2019-07-22 Arvind Sankar > > * gcc/configure.ac: Use GCC_PICFLAG. I know this is old Can you be more specific here about what you're trying to fix? ie, what host/target combination are you working on. What behavior are you seeing (presumably usage of -fPIC) what behavior did you expect (some other flag presumably). >From looking at picflag.m4 the thing I worry the most about is the various ix86/x86_64 clauses which specify -fpic. It looks like your change would cause us to start using -fpic rather than -fPIC as we've been doing for eons and I worry that might have unintended consequences. Thanks, Jeff >
[PATCH] Use GCC_PICFLAG to collect host-specific PICFLAG from ../config/picflag.m4
The gcc configure script does not use the config/picflag.m4 macro to customize PICFLAG according to the host when using --enable-host-shared. Fix configure.ac to do so. Tested bootstrap on x86_64-linux-gnu. 2019-07-22 Arvind Sankar * gcc/configure.ac: Use GCC_PICFLAG. --- gcc/configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/configure.ac b/gcc/configure.ac index c620dd2f447..f6bdfd52fa6 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -6543,7 +6543,7 @@ fi AC_ARG_ENABLE(host-shared, [AS_HELP_STRING([--enable-host-shared], [build host code as shared libraries])], -[PICFLAG=-fPIC], [PICFLAG=]) +[GCC_PICFLAG], [PICFLAG=]) AC_SUBST(enable_host_shared) AC_SUBST(PICFLAG) -- 2.21.0