make-target-2.sh PIE failure on ppc64le and ppc64
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
New
|
Undecided
|
Unassigned |
Bug Description
When building on a Debian sid system with the following package
versions:
Linux 5.8.0-3-powerpc64le #1 SMP Debian 5.8.14-1 (2020-10-10) ppc64le GNU/Linux
GNU assembler (GNU Binutils for Debian) 2.35.1
cc (Debian 9.3.0-18) 9.3.0
ldd (Debian GLIBC 2.30-8) 2.30
$ sh make.sh
results in:
[...]
//entering make-target-2.sh
//doing warm init - compilation phase
./src/runtime/sbcl: error while loading shared libraries: R_PPC64_ADDR16_HI reloc at 0x0000000105532f68 for symbol `' out of range
real 0m0.003s
user 0m0.001s
sys 0m0.002s
$ echo $?
127
$
Likewise on a Debian 10 ppc64 system with the following package versions:
Linux 5.2.0-2-powerpc64 #1 SMP Debian 5.2.9-2 (2019-08-21) ppc64 GNU/Linux
GNU assembler (GNU Binutils for Debian) 2.35.1
cc (Debian 10.2.0-13) 10.2.0
ldd (Debian GLIBC 2.31-4) 2.31
$ sh make.sh --arch=ppc64
results in:
[...]
//entering make-target-2.sh
//doing warm init - compilation phase
./src/runtime/sbcl: error while loading shared libraries: R_PPC64_ADDR16_HI reloc at 0x000000013fbc6e02 for symbol `' out of range
$ echo $?
127
$
These failures started showing up due to:
commit 78de8730813a8a2
Author: Douglas Katzman <email address hidden>
Date: Mon Sep 21 22:05:19 2020 -0400
Remove DISABLE_PIE
Use the toolchain default everywhere, whether it makes a PIE or not.
which resulted in sbcl being built as a position-
executable by default.
The attached patches fix the build in both cases; do they look OK?
They change the linkage table entry size on ppc64 to accommodate
call_into_c loading the two high address bytes. There may be a better
approach that keeps the entry size to 24 bytes; if that matters, I can
attempt another version of the patch.
The patches also do not attempt to handle the PIE-disabled case, where
the extra instructions aren't needed, the same as before. I'm not
sure how much that matters since PIE seems to be encouraged and
default now.
Doesn't it have some pseudo-instruction for loading constants?