Skip to content

PIC build error ubuntu, libressl #94

@mcarpenter

Description

@mcarpenter

Building commit 748ed6 of s2n on Ubuntu 14.04 x86_64 with gcc 4.8.4 and the (default) bfd linker.

I've tried libressl versions 2.2.0, 2.1.7, 2.0.5 and all produce similar errors when I try to make s2n:

gcc -shared -lc -lpthread -lrt -o libs2n.so ../utils/s2n_blob.o ../utils/s2n_mem.o ../utils/s2n_random.o ../utils/s2n_safety.o ../utils/s2n_timer.o ../stuffer/s2n_stuffer_base64.o ../stuffer/s2n_stuffer_file.o ../stuffer/s2n_stuffer.o ../stuffer/s2n_stuffer_pem.o ../stuffer/s2n_stuffer_text.o ../tls/s2n_aead.o ../tls/s2n_alerts.o ../tls/s2n_cbc.o ../tls/s2n_cipher_suites.o ../tls/s2n_client_ccs.o ../tls/s2n_client_extensions.o ../tls/s2n_client_finished.o ../tls/s2n_client_hello.o ../tls/s2n_client_key_exchange.o ../tls/s2n_config.o ../tls/s2n_connection.o ../tls/s2n_handshake_io.o ../tls/s2n_handshake.o ../tls/s2n_ocsp_stapling.o ../tls/s2n_prf.o ../tls/s2n_record_read.o ../tls/s2n_record_write.o ../tls/s2n_recv.o ../tls/s2n_send.o ../tls/s2n_server_ccs.o ../tls/s2n_server_cert.o ../tls/s2n_server_done.o ../tls/s2n_server_extensions.o ../tls/s2n_server_finished.o ../tls/s2n_server_hello.o ../tls/s2n_server_key_exchange.o ../tls/s2n_tls.o ../crypto/s2n_aead_cipher_aes_gcm.o ../crypto/s2n_cbc_cipher_3des.o ../crypto/s2n_cbc_cipher_aes.o ../crypto/s2n_dhe.o ../crypto/s2n_drbg.o ../crypto/s2n_ecc.o ../crypto/s2n_hash.o ../crypto/s2n_hmac.o ../crypto/s2n_rsa.o ../crypto/s2n_sequence.o ../crypto/s2n_stream_cipher_null.o ../crypto/s2n_stream_cipher_rc4.o ../error/s2n_errno.o ../libcrypto-root/lib/libcrypto.a
/usr/bin/ld: ../libcrypto-root/lib/libcrypto.a(libcrypto_la-cryptlib.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
../libcrypto-root/lib/libcrypto.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[1]: *** [libs2n.so] Error 1
make[1]: Leaving directory `/home/mcarpenter/s2n/lib'
make: *** [libs] Error 2

Following the hint it's enough to do export CFLAGS=-fPIC before building libressl (2.2.0) and then s2n. (Even then the s2n build doesn't quite complete since tests fail... but one step at a time).

Is this just a doc error ("please set CFLAGS")? Or is there something more fundamentally wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions