Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
To: buildroot@busybox.net
Subject: [Buildroot] perl packages: intrusion of host LDFLAGS
Date: Wed, 21 Jun 2017 16:08:02 +0200	[thread overview]
Message-ID: <20170621140802.GS29444@argentina> (raw)

Hi Fran?ois, all,

We try to add and build the perl-encode package. Adding the package works fine
with the scancpan script, but the build fails:

"/home/tdescham/repo/contrib/buildroot/output/host/usr/bin/perl" "/home/tdescham/repo/contrib/buildroot/output/host/usr/lib/perl5/5.24.1/ExtUtils/xsubpp"  -nolinenumbers -typemap "/home/tdescham/repo/contrib/buildroot/output/host/usr/lib/perl5/5.24.1/ExtUtils/typemap"  Byte.xs > Byte.xsc && mv Byte.xsc Byte.c
/usr/bin/gcc -c  -I../Encode -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64    -DVERSION=\"2.04\" -DXS_VERSION=\"2.04\" -fPIC "-I/home/tdescham/repo/contrib/buildroot/output/host/usr/i686-buildroot-linux-gnu/sysroot/usr/lib/perl5/5.24.1/i686-linux/CORE"   Byte.c
/usr/bin/gcc -c  -I../Encode -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64    -DVERSION=\"2.04\" -DXS_VERSION=\"2.04\" -fPIC "-I/home/tdescham/repo/contrib/buildroot/output/host/usr/i686-buildroot-linux-gnu/sysroot/usr/lib/perl5/5.24.1/i686-linux/CORE"   byte_t.c
rm -f ../blib/arch/auto/Encode/Byte/Byte.so
/home/tdescham/repo/contrib/buildroot/output/host/usr/bin/i686-pc-linux-gnu-gcc  -shared -O2 -L/usr/local/lib -fstack-protector-strong Byte.o byte_t.o  -o ../blib/arch/auto/Encode/Byte/Byte.so 	\
     	\
  
i686-pc-linux-gnu-gcc: ERROR: unsafe header/library path used in cross-compilation: '-L/usr/local/lib'
make[2]: *** [Makefile:461: ../blib/arch/auto/Encode/Byte/Byte.so] Error 1
make[2]: Leaving directory '/home/tdescham/repo/contrib/buildroot/output/build/perl-encode-2.90/Byte'
make[1]: *** [Makefile:697: subdirs] Error 2
make[1]: Leaving directory '/home/tdescham/repo/contrib/buildroot/output/build/perl-encode-2.90'
make: *** [package/pkg-generic.mk:230: /home/tdescham/repo/contrib/buildroot/output/build/perl-encode-2.90/.stamp_built] Error 2



Looking at the Makefile(s) generated from Makefile.PL in this package, there
is:
LDFLAGS =  -fstack-protector-strong -L/usr/local/lib

which seem to be flags taken from the host gcc installation: /usr/local/lib is
not correct anyway in Buildroot, and fstack-protector-strong is not known by the
Sourcery x86 compiler I was using in Buildroot.


I checked with another perl package (perl-net-dns) which is already included in
Buildroot, and found that its Makefile _also_ includes that /usr/local/lib
string, but it does not fail. I think this must be because it is not trying to
do C compilations.
Anyway, it gives me the impression that this needs to be handled in the perl
package infrastructure, rather than at module level.
I tried using a post-configure hook to remove the /usr/local/lib, but then
bumped into the fstack-protector-strong which is not generic and can thus not be
filtered out nicely.


Do you have any suggestion on how to proceed?

Thanks,
Thomas



-- 
Thomas De Schampheleire
Embedded Software Engineer
Fixed Networks, Nokia

             reply	other threads:[~2017-06-21 14:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-21 14:08 Thomas De Schampheleire [this message]
2017-06-21 19:35 ` [Buildroot] perl packages: intrusion of host LDFLAGS François Perrad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170621140802.GS29444@argentina \
    --to=thomas.de_schampheleire@nokia.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox