Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAR::Packer is not buildable on relocatable-perl 5.40.0.1 #21

Open
gugod opened this issue Dec 22, 2024 · 2 comments · May be fixed by #22
Open

PAR::Packer is not buildable on relocatable-perl 5.40.0.1 #21

gugod opened this issue Dec 22, 2024 · 2 comments · May be fixed by #22

Comments

@gugod
Copy link

gugod commented Dec 22, 2024

This is perhaps not directly related to relocatable-perl, but I'm sharing some brief finding here first.

Basically, cpm install -g PAR::Packer failed in relocatable-perl 5.40.0.1 with this compilation error:

cc main.o sha1.o  -s -Wl,-E  -fstack-protector-strong -L/usr/local/lib  -L/home/gugod/perl5/perlbrew/perls/skaji-relocatable-perl-5.40.0.1/lib/5.40.0/x86_64-linux/CORE -lperl -lpthread -ldl -lm -lcrypt -lutil -lc  -o ./par
/usr/bin/ld: /home/gugod/perl5/perlbrew/perls/skaji-relocatable-perl-5.40.0.1/lib/5.40.0/x86_64-linux/CORE/libperl.a(perl.o): in function `perl_construct':
/tmp/perl-build-1728287368.1/perl-5.40.0/perl.c:326:(.text+0x281b): undefined reference to `_LIB_VERSION'
collect2: error: ld returned 1 exit status

Here's how I could reproduce it on my Fedora Linux:

# uname -srvmo  
Linux 6.11.5-300.fc41.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Oct 22 20:11:15 UTC 2024 x86_64 GNU/Linux


# perlbrew --version
/home/gugod/perl5/perlbrew/bin/perlbrew  - App::perlbrew/1.01

## This step would download and install this tarball: https://github.com/skaji/relocatable-perl/releases/download/5.40.0.1/perl-linux-amd64.tar.gz
# perlbrew install skaji-relocatable-perl-5.40.0.1 

# perlbrew use skaji-relocatable-perl-5.40.0.1 

# which perl                                  
~/perl5/perlbrew/perls/skaji-relocatable-perl-5.40.0.1/bin/perl

# perl -V | grep config
Summary of my perl5 (revision 5 version 40 subversion 0) configuration:
    config_args='-Dprefix=/opt/perl -Duserelocatableinc -Dman1dir=none -Dman3dir=none -DDEBUGGING=-g -des -Ui_xlocale -Dlibs=-lpthread -ldl -lm -lcrypt -lutil -lc -Dd_crypt -Dlibpth=/lib /lib/x86_64-linux-gnu /lib64 /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib64 /usr/local/lib /usr/local/lib64'

# cpm install -g --show-build-log-on-failure PAR::Packer
.......
2024-12-23T08:41:34,118330,PAR-Packer-1.063| cc main.o sha1.o  -s -Wl,-E  -fstack-protector-strong -L/usr/local/lib  -L/home/gugod/perl5/perlbrew/perls/skaji-relocatable-perl-5.40.0.1/lib/5.40.0/x86_64-linux/CORE -lperl -lpthread -ldl -lm -lcrypt -lutil -lc  -o ./par
2024-12-23T08:41:34,118330,PAR-Packer-1.063| /usr/bin/ld: /home/gugod/perl5/perlbrew/perls/skaji-relocatable-perl-5.40.0.1/lib/5.40.0/x86_64-linux/CORE/libperl.a(perl.o): in function `perl_construct':
2024-12-23T08:41:34,118330,PAR-Packer-1.063| /tmp/perl-build-1728287368.1/perl-5.40.0/perl.c:326:(.text+0x281b): undefined reference to `_LIB_VERSION'
2024-12-23T08:41:34,118330,PAR-Packer-1.063| collect2: error: ld returned 1 exit status
2024-12-23T08:41:34,118330,PAR-Packer-1.063| make[1]: *** [Makefile:887: par] Error 1
2024-12-23T08:41:34,118330,PAR-Packer-1.063| make[1]: Leaving directory '/home/gugod/.perl-cpm/work/1734910891.118325/PAR-Packer-1.063/myldr'
2024-12-23T08:41:34,118330,PAR-Packer-1.063| make: *** [Makefile:547: subdirs] Error 2
...

@skaji
Copy link
Owner

skaji commented Dec 23, 2024

Thank you for the report. I will take a look at it.

@skaji
Copy link
Owner

skaji commented Dec 30, 2024

  • The issue undefined reference to _LIB_VERSION will be fixed by compiling relocatabale-perls with -Ud_libm_lib_version.
  • However, even if we build relocatabale-perls with -Ud_libm_lib_version, creating executables with libperl.a would fail with relocation R_X86_64_32 against symbol PL_memory_wrap can not be used when making a PIE object; recompile with -fPIE. This is because gcc in recent OSes configured with --enable-default-pie.

@skaji skaji linked a pull request Dec 31, 2024 that will close this issue
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 a pull request may close this issue.

2 participants