-
Notifications
You must be signed in to change notification settings - Fork 51
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
Makefile.PL uses wrong system header path when Perl has been compiled with -Dsysroot #217
Comments
Re the LIBS issue, the workaround is wrong. After replacing
Something in the toolchain (GNU ld? ExtUtils::MakeMaker?) hardcodes the rpath to the sysroot when linking against -lrt. |
Can you supply the complete Also, can you explain why you are using such a relocatable Thanks. |
It's an unusual setup. I have a sysroot in /pkgs64/centos6-sysroot, which is a bare CentOS 6 system. I have compiled GCC 11 using --sysroot=/pkgs64/centos6-sysroot and installed the binaries in /pkgs64/gcc/11.3.0-c6. The goal is to be able to use a new(er) toolchain while creating binaries that target glibc 2.12 (CentOS 6), without being stuck on running everything in a CentOS 6 VM. The actual use case is, we are bundling Perl as part of a product. The product doesn't have a fixed install path; the end user can install it in any path. We build a relocatable Perl built using the above sysroot, which means we don't need to relocate anything at install time, and we don't need to worry about glibc compatibility. We don't need Devel::NYTprof on end user systems, but it's really useful to have it for development (it's a great profiler!). Please treat the bug report as a nice to have improvement than something many people will need.
Here $XYZZY is some arbitrary directory on the build system. |
Makefile.PL sets include directories like so:
Why is it using
$Config{libsdirs}
? I have built a (relocatable) Perl using -Dsysroot, which means libsdirs is set to:When I run
perl Makefile.PL
, it emits a compiler warning that causes gettime to be disabled:The reason is,
$Config{libsdirs}
doesn't contain any system headers from the sysroot, so it's defaulting to the host system's /usr/include. Changing Makefile.PL to$Config{incpth}
fixes it. In my Perl, it's:Unfortunately, this isn't the end of the story! With the defaults, the link command is:
This looks OK, but I think the LD_RUN_PATH is wrong (and this could be an ExtUtils::MakeMaker problem), because the tests fail immediately with:
I can work around it by clearing LIBS:
Which results in the link command:
And now all Devel::NYTProf tests pass. To summarise,
$Config{libsdirs}
definitely seems wrong, but the -lrt issue could be a fault in my sysroot or Perl compilation.The text was updated successfully, but these errors were encountered: