Re: Overriding of Perl compilation flags for non-default compiler

Bruno Haible via Bug reports for the GNU Texinfo documentation system <[email protected]>
Newsgroups gmane.comp.tex.texinfo.bugs
Organization GNU
Message-ID <2612272.FA4qHCu0Kp@nimes>
Hi Gavin,

> > So, IMO the way to go forward with this, i.e. to allow a different compiler
> > but without running into link errors, is
> >   1) from the Perl configuration, extract the ABI,
> >   2) from $CC and $CFLAGS, extract the ABI (e.g. using Gnulib's gl_HOST_CPU_C_ABI
> >      macro, module 'host-cpu-c-abi'),
> >   3) compare the two ABIs and err out if they are different.
> > 
> Unfortunately builds tend to break in strange ways if the compiler flags
> aren't exactly the same way, even if the ABI as you describe matches.

Oh well. Sigh. I didn't know that you already went through all this trouble
on this issue.

> Here are some of Perl's flags, listed in the copy of tta/config.log in
> my build tree:
> 
> perl_conf_CFLAGS='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
> perl_conf_CPPFLAGS='-I/usr/lib/x86_64-linux-gnu/perl/5.38/CORE'
> perl_conf_EMBED_LIB_CFLAGS='-fPIC'
> perl_conf_LDFLAGS='-Wl,-E  -fstack-protector-strong -L/usr/local/lib'
> perl_conf_LIBS='-L/usr/lib/x86_64-linux-gnu/perl/5.38/CORE -lperl'
> perl_conf_LIB_CFLAGS='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC'
> perl_conf_LIB_LDFLAGS='-Wl,-E  -fstack-protector-strong -L/usr/local/lib'

Indeed, -D_LARGEFILE_SOURCE, -D_FILE_OFFSET_BITS=64, and probably also
-fstack-protector-strong all modify the ABI. And on 32-bit glibc platforms
there's now also the 64-bit time_t option. And so on...

It's a harder problem than I imagined.

Bruno
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.