[Slackbuilds-users] 32-bit fails
B. Watson
urchlay at slackware.uk
Sun Mar 27 20:35:52 UTC 2022
On Sun, 27 Mar 2022, Lenard Spencer wrote:
> If all fails, unless anything on SBo absolutely needs openjdk 6 or 7, we may
> have to just drop those two.
No, if all else fails, we'd have to mark them as unsupported on
32-bit. They build fine on 64-bit, don't they?
It'd be nicer to have them building on 32-bit... you're running into
the same libstdc++ issue I ran into, so at least we can duplicate the
problem. That's a step in the right direction.
One thing you can try to do. Instead of -lstdc++ in
the command, you can replace that with the full path
to the actual .so file. Like if it's doing this:
gcc -o foo -lstdc++ <blah blah>
you can replace that with:
gcc -o foo /usr/lib64/gcc/x86_64-slackware-linux/5.5.0/libstdc++.so
...on 64-bit; the path is different on 32-bit of course.
Another thing: you can find the correct path to gcc5's libstdc++.so
on either 32-bit or 64-bit like so:
user at slack64$ gcc-5 --print-file-name libstdc++.so
/usr/lib64/gcc/x86_64-slackware-linux/5.5.0/libstdc++.so
user at slack32$ gcc-5 --print-file-name libstdc++.so
/usr/lib/gcc/i586-slackware-linux/5.5.0/libstdc++.so
So in a simpler build script, you could probably do this:
sed -i "s,-lstdc++,$( gcc-5 --print-file-name libstdc++.so )," Makefile
...which combines the two.
Trouble with the openjdk* builds is that it's a PITA to patch anything
due to the multiple tarballs and sha checksums (you had to unpack,
patch, repack, then calculate a new checksum and patch the main
build).
The other potential problem: the command above would fix linking
during the build... you'd also want to make sure the *runtime* linker
finds the correct libstdc++.so. This may or may not be a problem, you'd
run ldd on the binary to find out for sure. If ldd shows libstdc++ from
/usr/lib is being used, you'll have to use "-Wl,-rpath". Something
like this might do:
D=$( dirname $( gcc-5 --print-file-name libstdc++.so ))
SLKCFLAGS+=" -L$D -Wl,-rpath $D"
The -L tells the compiler what to link with at build time, and the
-Wl,-rpath embeds the path to the library in the binary, where it gets
applied when the compiled binary is actually run.
I'm not even sure whether openjdk7.SlackBuild actually uses SLKCFLAGS,
but you get the idea I hope.
More information about the SlackBuilds-users
mailing list