arsv / perl-cross

configure and cross-compile perl
Other
81 stars 29 forks source link

Building error trying against perl 5.26.1 #58

Open selkfoster opened 6 years ago

selkfoster commented 6 years ago

Hello :-)

Since the version of perl-cross 1.1.4 I can't compile perl-5.26.1 using the latest versions of perl-cross as static. I am still sticky to perl-5.24.1, perl-cross 1.1.4. This is the error that I am getting from the compilation (using perl-5.26.1/perl-cross 1.1.8):

[..] mv shared.xsc shared.c x86_64-linux-musl-gcc -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fwrapv -fno-strict-aliasing -DVERSION=\"1.56\" -DXS_VERSION=\"1.56\" -fPIC -Wno-unused-function "-I../.." shared.c rm -f ../../lib/auto/threads/shared/shared.so x86_64-linux-musl-gcc -shared shared.o -o ../../lib/auto/threads/shared/shared.so \ -lpthread \

chmod 755 ../../lib/auto/threads/shared/shared.so make[1]: Leaving directory '/diver/dragora/git/OUTPUT.bootstrap/sources/perl-5.26.1/dist/threads-shared' ./miniperl_top statars B Devel::Peek Fcntl File::DosGlob File::Glob Hash::Util Hash::Util::FieldHash I18N::Langinfo Opcode POSIX PerlIO::encoding PerlIO::mmap PerlIO::scalar PerlIO::via SDBM_File Sys::Hostname Tie::Hash::NamedCapture XS::APItest XS::Typemap arybase attributes mro re Compress::Raw::Bzip2 Compress::Raw::Zlib Devel::PPPort Digest::MD5 Digest::SHA Encode Filter::Util::Call IPC::SysV MIME::Base64 Math::BigInt::FastCalc List::Util Socket Sys::Syslog Time::Piece Unicode::Collate Data::Dumper IO Cwd Storable Time::HiRes Unicode::Normalize threads threads::shared > static.list Can't find .a file for B Makefile:160: recipe for target 'static.list' failed make: *** [static.list] Error 2

The building options were the same as the previous with perl-5.24.1:

./configure \ --prefix=/tools \ --target=$target \ --all-static \ -Dprivlib=/tools/lib${libSuffix}/perl5 \ -Dsitelib=/tools/lib${libSuffix}/perl5/site_perl \ -A ldflags="$BTLDFLAGS -static"

arsv commented 6 years ago

Can you please check if this branch fixes the build for you?

https://github.com/arsv/perl-cross/tree/static

The immediate cause of the failure is that it builds modules as dynamic regardless of supplied LINKTYPE. The reason for that is somewhere in the depths of MakeMaker, not sure about it yet.

selkfoster commented 6 years ago

Sorry for the delay. I am testing it now.

It seems to work but I am re-processing it again to make the confirmation.

My goal is to obtain perl as static, while it can load the XS modules dynamically. This is possible for a native installation using perl-cross?.

Note: Currently I am using it (perl/perl-cross) for a temporary system, later the native installation is made. But I want to achieve the same as above ^, I wonder if will work...

selkfoster commented 6 years ago

Yes! it works with the 'static' branch. Sorry for my last question, what I want to achieve to replace this temporary perl, is to see if I can build perl/perl-cross in the same way, the perl binary as static and the external modules (.pm). What do you think?

arsv commented 6 years ago

For static perl with dynamic modules, try something like

./configure ... -Dldflags=-static -Accflags=-fno-pie

Depends on toolchain, some should link just fine without -fno-pie.