Add support for compiles on HPE NonStop
Fixes: #229
I still need help convincing configure to build a DLL. The arguments are not the same as for gcc and configure gets confused about it. -Wshared is the trigger to build .so files.
Looking at the relevant libtool logic it appears that it matches irix5* | irix6* | nonstopux* and defines $archive_cmds to use -shared. Rough summary:
if test yes = "$GCC"; then
archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
else
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
Looking at the relevant libtool logic it appears that it matches
irix5* | irix6* | nonstopux*and defines$archive_cmdsto use-shared. Rough summary:if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
nonstopux* is not the same. It is, in fact, deprecated - old product naming from when Compaq owned Tandem and made everything "NonStop". This is a separate set of platforms - nsx-tandem-nsk and nse-tandem-nsk are currently value entries from config.guess. -Wshared is what is needed.
:(
Those host identifiers aren't shown anywhere in libtool.m4 (which is used to generate the libtool script by configure) that I can tell.
My conclusion is that while config.guess knows the platform exists, libtool in particular doesn't actually do anything whatsoever with that information and does not know how to build libraries for nonstop. (This is ironic since the one selling point of libtool is supposed to be that it works on any platform ever.)
Explains why libtool is a noop on the platform
This PR also includes changes to some tests to honor HAVE_ALLOCA_H. The changes build and test correctly on the NonStop (TANDEM) x86 platform.
@rsbeckerca Thanks for your contribution ! If we can get in #228, there should be no need to include network header files. I'll come back to here once #228 has been closed or merged.
@rsbeckerca Thanks for your contribution ! If we can get in #228, there should be no need to include network header files. I'll come back to here once #228 has been closed or merged.
Let me know when you are ready. I can reroll the PR if you want. I think netdb.h is also required but not for #228.
@rsbeckerca Removal of alloca: #231 Please drop that alloca commit from your PR (feel free to force-push).
@rsbeckerca Removal of alloca: #231 Please drop that alloca commit from your PR (feel free to force-push).
Should be done. I repushed the original commit dropping e85cddd.
@rsbeckerca Can you try to build and run tests from latest master without any changes?
@rsbeckerca Can you try to build and run tests from latest master without any changes?
No, there are a few patches I have to apply to make this work. The summary of what I have to do from the tarball is as follows:
sed "/<ws2tcpip.h>/a #elif defined __TANDEM" -i src/psl.c
sed "/defined __TANDEM/a # include <unistd.h>" -i src/psl.c
sed "/defined __TANDEM/a # include <netinet/in.h>" -i src/psl.c
sed "/defined __TANDEM/a # include <netinet/in6.h>" -i src/psl.c
sed "/defined __TANDEM/a # include <netdb.h>" -i src/psl.c
sed "/defined __TANDEM/a # include <sys/socket.h>" -i src/psl.c
sed "s/alloca(/(char *)malloc(/g" -i tests/test-is-cookie-domain-acceptable.c
sed "s/alloca(/(char *)malloc(/g" -i tests/test-is-public-all.c
sed "s/alloca(/(char *)malloc(/g" -i tests/test-is-public-builtin.c
sed "s/alloca(/(char *)malloc(/g" -i tests/test-is-public.c
sed "s/alloca(/(char *)malloc(/g" -i tests/test-registrable-domain.c
@rsbeckerca Can you try to build and run tests from latest master without any changes?
No, there are a few patches I have to apply to make this work. The summary of what I have to do from the tarball is as follows:
sed "/<ws2tcpip.h>/a #elif defined __TANDEM" -i src/psl.c sed "/defined __TANDEM/a # include <unistd.h>" -i src/psl.c sed "/defined __TANDEM/a # include <netinet/in.h>" -i src/psl.c sed "/defined __TANDEM/a # include <netinet/in6.h>" -i src/psl.c sed "/defined __TANDEM/a # include <netdb.h>" -i src/psl.c sed "/defined __TANDEM/a # include <sys/socket.h>" -i src/psl.c sed "s/alloca(/(char *)malloc(/g" -i tests/test-is-cookie-domain-acceptable.c sed "s/alloca(/(char *)malloc(/g" -i tests/test-is-public-all.c sed "s/alloca(/(char *)malloc(/g" -i tests/test-is-public-builtin.c sed "s/alloca(/(char *)malloc(/g" -i tests/test-is-public.c sed "s/alloca(/(char *)malloc(/g" -i tests/test-registrable-domain.c
Are you sure you are using latest git master? Because all usages of alloca() have been replaced/removed, as well as all the network related include directives.
Latest commit is
commit 15e7f407cbadf950410e45d97e76773b40377ac6 (HEAD -> master, origin/master, origin/HEAD)
Author: Tim Rühsen <[email protected]>
Date: Sat Mar 23 18:16:17 2024 +0100
Just saw you are building from tarball... here the tarball with the latest changes: libpsl-0.21.5-15e7f407.tar.gz
I can build libpsl.a from the above tarball. Thanks. configure.ac needs a little tweeking to get a .so file, but I don't have a delivery requirement for that, so it is fine as is for now.
I can build libpsl.a from the above tarball. Thanks. configure.ac needs a little tweeking to get a .so file, but I don't have a delivery requirement for that, so it is fine as is for now.
Thanks for testing. Then I close this issue and #229.