From owner-freebsd-erlang@freebsd.org Sun Jul 12 14:54:37 2020 Return-Path: Delivered-To: freebsd-erlang@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4889B365814 for ; Sun, 12 Jul 2020 14:54:37 +0000 (UTC) (envelope-from list1@gjunka.com) Received: from msa1.earth.yoonka.com (yoonka.com [88.98.225.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "msa1.earth.yoonka.com", Issuer "msa1.earth.yoonka.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B4VDX0dmFz4cRX for ; Sun, 12 Jul 2020 14:54:35 +0000 (UTC) (envelope-from list1@gjunka.com) Received: from venus.yoonka.com ([10.70.7.24]) (authenticated bits=0) by msa1.earth.yoonka.com (8.15.2/8.15.2) with ESMTPSA id 06CEsSf8016971 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sun, 12 Jul 2020 14:54:28 GMT (envelope-from list1@gjunka.com) X-Authentication-Warning: msa1.earth.yoonka.com: Host [10.70.7.24] claimed to be venus.yoonka.com To: freebsd-erlang@freebsd.org From: Grzegorz Junka Subject: Compiling static Erlang Message-ID: Date: Sun, 12 Jul 2020 14:54:22 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Rspamd-Queue-Id: 4B4VDX0dmFz4cRX X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of list1@gjunka.com designates 88.98.225.149 as permitted sender) smtp.mailfrom=list1@gjunka.com X-Spamd-Result: default: False [-2.38 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:88.98.225.149]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-erlang@freebsd.org]; HAS_XAW(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.92)[-0.920]; TO_DN_NONE(0.00)[]; NEURAL_HAM_SHORT(-0.24)[-0.235]; DMARC_NA(0.00)[gjunka.com]; NEURAL_HAM_MEDIUM(-0.93)[-0.925]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:56478, ipnet:88.98.192.0/18, country:GB]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-erlang@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Support of Erlang-related ports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jul 2020 14:54:37 -0000 I am trying to compile Erlang so that it doesn't use shared libraries. The compilation fails with linking errors, two examples: ld: error: relocation R_X86_64_PC32 cannot be used against symbol __stack_chk_guard; recompile with -fPIC >>> defined in /lib/libc.so.7 >>> referenced by aes_ige.c:0 (/usr/src-13/crypto/openssl/crypto/aes/aes_ige.c:0) >>>               aes_ige.o:(AES_ige_encrypt) in archive /usr/lib/libcrypto.a ld: error: can't create dynamic relocation R_X86_64_32 against local symbol in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output >>> defined in /usr/lib/libcrypto.a(aes_ige.o) >>> referenced by aes_ige.c:47 (/usr/src-13/crypto/openssl/crypto/aes/aes_ige.c:47) >>>               aes_ige.o:(AES_ige_encrypt) in archive /usr/lib/libcrypto.a I understand it complains about /usr/lib/libcrypto.a and /lib/libc.so.7 (in this example) not compiled with fPIC? Do I need to recompile world with fPIC enabled for this to work? I was trying with these configure options: ./configure --prefix=/home/g/work/erlang --enable-pie --with-ssl --disable-dynamic-ssl-lib --disable-hipe --enable-builtin-zlip --enable-kernel-poll --enable-sctp --enable-native-libs --enable-dirty-schedulers --disable-shared --enable-static --with-javac=no --with-odbc=no GrzegorzJ