PeterMosmans / openssl

'Extra featured' OpenSSL with ChaCha20 and Poly1305 support
https://onwebsecurity.com/pages/openssl.html
Other
92 stars 18 forks source link

Shared Library OpenSSL building fails #47

Closed splitice closed 7 years ago

splitice commented 7 years ago

Commands:

./config --shared
make

Results in:

ssltestlib.o: In function `main':
ssltestlib.c:(.text.startup+0x0): multiple definition of `main'
dtlstest.o:dtlstest.c:(.text.startup+0x0): first defined here
dtlstest.o: In function `test_dtls_unprocessed':
dtlstest.c:(.text+0x6f): undefined reference to `create_ssl_ctx_pair'
dtlstest.c:(.text+0xb5): undefined reference to `bio_f_tls_dump_filter'
dtlstest.c:(.text+0xe4): undefined reference to `create_ssl_objects'
dtlstest.c:(.text+0x12e): undefined reference to `mempacket_test_inject'
dtlstest.c:(.text+0x13d): undefined reference to `create_ssl_connection'
collect2: error: ld returned 1 exit status
../Makefile.shared:171: recipe for target 'link_app.gnu' failed
make[2]: *** [link_app.gnu] Error 1
make[2]: Leaving directory '/tmp/build_path/openssl-shared/test'
Makefile:585: recipe for target 'dtlstest' failed
make[1]: *** [dtlstest] Error 2
make[1]: Leaving directory '/tmp/build_path/openssl-shared/test'
Makefile:298: recipe for target 'build_tests' failed
make: *** [build_tests] Error 1
PeterMosmans commented 7 years ago

Hi - as the compiling succeeds on all continuous integration tests: could you please let me know the commands you're using, the platform and compiler ? Thanks !

splitice commented 7 years ago

I am compiling on 64bit against a 32bit architecture. The build system handle the architecture side (nothing changed on our end since our last build, just a fresh clone).

Does this work for you?

setarch i386 ./config --shared -m32
make
PeterMosmans commented 7 years ago

Did you try the regular make clean; make dclean; ./Configure shared && make depend && make && make report ?

splitice commented 7 years ago

Ok, I found the issue.

make clean; make dclean isnt cleaning everything up. From a fresh checkout it works. If I repeat it doesnt. I managed to get this with the same architecture previously, but this more closely represents a the build process.

git clone https://github.com/PeterMosmans/openssl.git
cd openssl
./config --shared
make
make clean
make dclean
setarch i386 ./config --shared -m32
make

I'll put a `git clean -d -x -f;git reset --hard HEAD`` for now between runs.

PeterMosmans commented 7 years ago

Thanks for letting me know. Yeah, unfortunately that happens with more projects, build artefacts that aren' properly cleaned and, erm, stuff things up.

Closing the issue