Configuration/build system: ensure test runs in user environment..
commit18459cfcf8fcbbbbd631b51d20842205809c65b3
authorSteffen Nurpmeso <steffen@sdaoden.eu>
Sat, 21 Oct 2017 14:56:52 +0000 (21 16:56 +0200)
committerSteffen Nurpmeso <steffen@sdaoden.eu>
Sat, 21 Oct 2017 21:29:01 +0000 (21 23:29 +0200)
tree19b405a73f7cc46f13ed423ae8f80964b6975098
parent3ecf17ca49390e45048871ce0c4871a6500c6319
Configuration/build system: ensure test runs in user environment..

On the OpenCSW cluster i have found myself in the grotesque
situation that the test is running whereas the binary as such is
unusable:

  ?0[sdaoden@unstable11x nail.git]$ make test
  ...
  [t_behave_s_mime]
  behave:s/mime: .. generating test key and certificate ..
  behave:s/mime:sign/verify: ok
  ...
  behave:s/mime:decrypt:disproof-1: ok
  ...
  ?0[sdaoden@unstable11x nail.git]$ ./s-nail -R
  ld.so.1: s-nail: fatal: relocation error: file s-nail: symbol SSL_CONF_CTX_new: referenced symbol not found
  Killed

So despite that the gcc there is buggy by placing /usr/lib first
in the searchlist no matter what i do

  $ gcc -Wl,-R/opt/csw/lib -Wl,-R/usr/xpg4/lib
    -Wl,-R/home/sdaoden/usr/lib -Wl,-R/lib -Wl,-R/usr/lib
    -Wl,-R/usr/X11/lib -pie  -o s-nail
  ...
  $ elfdump -d s-nail
  ...
     [11]  RUNPATH         0x4690     /usr/lib:/opt/csw/lib:/usr/xpg4/lib:/home/sdaoden/usr/lib:/lib:/usr/X11/lib
     [12]  RPATH           0x4690     /usr/lib:/opt/csw/lib:/usr/xpg4/lib:/home/sdaoden/usr/lib:/lib:/usr/X11/lib

that can be fixed with Solaris Studio:

  $ make all CC=/opt/solarisstudio12.4/bin/cc
  ...
   [11]  RUNPATH         0x50a4     /opt/csw/lib:/usr/xpg4/lib:/home/sdaoden/usr/lib:/lib:/usr/lib:/usr/X11/lib:/usr/lib
   [12]  RPATH           0x50a4     /opt/csw/lib:/usr/xpg4/lib:/home/sdaoden/usr/lib:/lib:/usr/lib:/usr/X11/lib:/usr/lib

though that blindly seems to append /usr/lib even though that
already is included (or is that a bug of mine :-o???) but it seems
as if LD_LIBRARY_PATH is preferred not only over DT_RUNPATH, which
is fine, but also over DT_RPATH?  That is surely a bug in the
linker, then.  I already committed a change that avoids checking
for -Wl,--enable-new-dtags when we modify LD_LIBRARY_PATH
(make-config.sh: prefer DT_RPATH over DT_RUNPATH when modified
LD_LIBRARY_PATH)

In order to be able to get such problems reflected by the test,
avoid to modify the users environment as much as possible.
cc-test.sh
make-config.in
make-config.sh
makefile