From owner-freebsd-stable@FreeBSD.ORG Mon Feb 2 07:47:45 2015 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F4F3C10 for ; Mon, 2 Feb 2015 07:47:45 +0000 (UTC) Received: from nskntqsrv01p.mx.bigpond.com (nskntqsrv01p.mx.bigpond.com [61.9.168.231]) by mx1.freebsd.org (Postfix) with ESMTP id A0B81B80 for ; Mon, 2 Feb 2015 07:47:43 +0000 (UTC) Received: from nskntcmgw06p ([61.9.169.166]) by nskntmtas04p.mx.bigpond.com with ESMTP id <20150202074503.WTCK17495.nskntmtas04p.mx.bigpond.com@nskntcmgw06p> for ; Mon, 2 Feb 2015 07:45:03 +0000 Received: from hermes.heuristicsystems.com.au ([203.41.22.114]) by nskntcmgw06p with BigPond Outbound id nKl21p00Z2ThMyb01Kl2N9; Mon, 02 Feb 2015 07:45:03 +0000 X-Authority-Analysis: v=2.0 cv=RsdH3VaK c=1 sm=1 a=tBIanQelQkU72CJWnm+MWA==:17 a=XD52yEjQpfAA:10 a=IkcTkHD0fZMA:10 a=GHIR_BbyAAAA:8 a=0HtSIViG9nkA:10 a=rZHxXkpWb5cBRS5r34cA:9 a=QEXdDO2ut3YA:10 a=tBIanQelQkU72CJWnm+MWA==:117 Received: from [10.0.5.3] (ewsw01.hs [10.0.5.3]) (authenticated bits=0) by hermes.heuristicsystems.com.au (8.14.5/8.13.6) with ESMTP id t127i7BK021622 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Mon, 2 Feb 2015 18:44:13 +1100 (EST) (envelope-from dewayne.geraghty@heuristicsystems.com.au) Message-ID: <54CF2AC5.1000508@heuristicsystems.com.au> Date: Mon, 02 Feb 2015 18:44:05 +1100 From: Dewayne Geraghty User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: FreeBSD Stable Mailing List Subject: Requested to rebuild /usr/lib/crt1.o with fPIC during vsftpd build Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2015 07:47:45 -0000 While trying to build ftp/vsftpd with different values of -march and gcc48, I receive this message (on 10.1Stable r277875M, amd64) /usr/local/bin/ld: /usr/lib/crt1.o: relocation R_X86_64_32 against `_DYNAMIC' can not be used when making a shared object; recompile with -fPIC Should I "just" add -fPIC to /usr/src/lib/csu/amd64/Makefile CFLAGS+= -fno-omit-frame-pointer -fPIC What are the likely ramifications? Detail cd /usr/ports/ftp/vsftpd && make clean deinstall package ... /usr/local/bin/gcc48 -o vsftpd main.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o tunables.o ftpdataio.o secbuf.o ls.o postprivparent.o logging.o str.o netstr.o sysstr.o strlist.o banner.o filestr.o parseconf.o secutil.o ascii.o oneprocess.o twoprocess.o privops.o standalone.o hash.o tcpwrap.o ipaddrparse.o access.o features.o readwrite.o opts.o ssl.o sslslave.o ptracesandbox.o ftppolicy.o sysutil.o sysdeputil.o seccompsandbox.o -lssp_nonshared -Wl,-rpath,/usr/local/lib -L/usr/local/lib -fPIE -pie -Wl,-z,relro -Wl,-z,now `./vsf_findlibs.sh` /usr/local/bin/ld: /usr/lib/crt1.o: relocation R_X86_64_32 against `_DYNAMIC' can not be used when making a shared object; recompile with -fPIC /usr/lib/crt1.o: error adding symbols: Bad value collect2: error: ld returned 1 exit status *** [vsftpd] Error code 1 In this case, I'm using CFLAGS of -O2 -pipe -g0 -ggdb0 -DSTRIP_FBSDID -UDEBUGGING -UEBUGGING -UDEBUG -fPIC -march=core2 -mtune=core2 -I/usr/local/include -fno-strict-aliasing -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wshadow -Werror -Wformat-security -D_FORTIFY_SOURCE=2 I'm surprised that gcc is requesting that I rebuild crt1.o with -fPIC, while clang happily builds ftp/vsftpd. More importantly, are there any negative ramifications of building crt1 with -fPIC?? Examining the /usr/src/lib/csu/amd64/Makefile, which contains: Scrt1.s: crt1.c ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c sed ${SED_FIX_NOTE} ${.TARGET} makes this request very confusing! Regards, Dewayne