From owner-freebsd-arm@freebsd.org Fri Feb 19 22:26:25 2016 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 052FAAADD9B for ; Fri, 19 Feb 2016 22:26:25 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-211-152.reflexion.net [208.70.211.152]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAB8B1010 for ; Fri, 19 Feb 2016 22:26:24 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 22144 invoked from network); 19 Feb 2016 22:26:39 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 19 Feb 2016 22:26:39 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v7.80.0) with SMTP; Fri, 19 Feb 2016 17:26:26 -0500 (EST) Received: (qmail 16800 invoked from network); 19 Feb 2016 22:26:26 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with SMTP; 19 Feb 2016 22:26:26 -0000 X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network Received: from [192.168.1.8] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id AF7271C43A8; Fri, 19 Feb 2016 14:26:18 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: I've submitted 207324 for lang/lua52 needing to use -fPIC (kyua build blocked, clang380-import context) From: Mark Millard In-Reply-To: Date: Fri, 19 Feb 2016 14:26:22 -0800 Cc: Russell Haley , freebsd-arm Content-Transfer-Encoding: quoted-printable Message-Id: <9B10FB3B-257C-4282-932D-E53376678FB5@dsl-only.net> References: <1455917714.1294.25.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.2104) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2016 22:26:25 -0000 On 2016-Feb-19, at 2:18 PM, Mark Millard wrote: >=20 > On 2016-Feb-19, at 1:35 PM, Ian Lepore wrote: >>=20 >> On Fri, 2016-02-19 at 12:42 -0800, Russell Haley wrote: >>> On Fri, Feb 19, 2016 at 12:38 PM, Russell Haley = >>> wrote: >>>> On Fri, Feb 19, 2016 at 12:34 PM, Russell Haley < >>>> russ.haley@gmail.com> wrote: >>>>> On Fri, Feb 19, 2016 at 11:43 AM, Mark Millard < >>>>> markmi@dsl-only.net> wrote: >>>>>> When attempting to build devel/kyua on a rpi2b under >>>>>> projects/clang380-import -r295601 via portmaster -DK devel/kyua >>>>>> the attempt failed in lang/lua52 with: >>>>>>=20 >>>>>> --- lapi.o --- >>>>>> /usr/bin/clang -target armv6--freebsd11.0-gnueabi -march=3Darmv7 >>>>>> -a -mcpu=3Dcortex-a7 -mfloat-abi=3Dsoftfp -mno-unaligned-access=20= >>>>>> -B/usr/local/arm-gnueabi-freebsd/bin/ -Wall -DLUA_COMPAT_ALL =20 >>>>>> -pipe -mfloat-abi=3Dsoftfp -isystem /usr/local/include -g -fno >>>>>> -strict-aliasing -I/usr/local/include -isystem >>>>>> /usr/local/include -DLUA_USE_LINUX -c lapi.c -o lapi.o >>>>>> . . . >>>>>> --- liblua-5.2.so --- >>>>>> /usr/local/arm-gnueabi-freebsd/bin/ld: lapi.o: relocation >>>>>> R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when >>>>>> making a shared object; recompile with -fPIC >>>>>> lapi.o: error adding symbols: Bad value >>>>>> clang: error: linker command failed with exit code 1 (use -v to >>>>>> see invocation) >>>>>> *** [liblua-5.2.so] Error code 1 >>>>>>=20 >>>>> I'm not sure about the kyua stuff, but I was getting a "similar >>>>> error" >>>>> when I built lua5.3 using clang on x64. =46rom memory, I recall >>>>> adding >>>>> the -fPIC option to the lua5.3 Makefile (as the error indicates) >>>>> and >>>>> also having to remove a -luab (or something like that) and then >>>>> it >>>>> worked. Potentially you could just install lua from ports first? >>>>=20 >>>>> http://www.freshports.org/lang/lua52/ >>>>=20 >>>> Sorry, I meant pkg. But it looks like it's not being built for >>>> armv6? >>>> http://portsmon.freebsd.org/portoverview.py?category=3Dlang&portname=3D= >>>> lua52 >>>>=20 >>>> Russ >>>=20 >>> Okay, if you look at the Makefile for Lau52 at line 60 there are=20 >>> -fPIC >>> cflags for other platforms but armv6 and i386 are missing. >>>=20 >>> = https://svnweb.freebsd.org/ports/head/lang/lua52/Makefile?view=3Dmarkup >>>=20 >>=20 >> Are you guys setting CPUTYPE in your make.conf? I've been building >> lua52 and lua53 for a while without any problems, as crossbuilds or >> native on a wandboard, but I'm not setting cpu type or arch. >>=20 >> Also, why are you using lua52 rather than lua53? (Just curious.) >>=20 >> I'm about to commit an unrelated fix for lua53. I'll look into this >> problem too, if I can figure out how to recreate it. >>=20 >> -- Ian >=20 > I tried to build devel/kyua via portmaster and lang/lua52 got involved = in the process by default. Apparently this is indirectly via devel/lutok = being used. >=20 > As for one of the example make.conf's that I'm using that results in = the behavior: > (it does target -march=3Darmv7-a -mcpu=3Dcortex-a7 very explicitly) >=20 >> # more /etc/make.conf >> DEFAULT_VERSIONS+=3Dperl5=3D5.22 >> WRKDIRPREFIX=3D/usr/obj/portswork >> WITH_DEBUG=3D >> WITH_DEBUG_FILES=3D >> MALLOC_PRODUCTION=3D >> # >> TO_TYPE=3Darmv6 >> VERSION_CONTEXT=3D11.0 >> CFLAGS+=3D-target ${TO_TYPE}--freebsd${VERSION_CONTEXT}-gnueabi = -march=3Darmv7-a -mcpu=3Dcortex-a7 -mfloat-abi=3Dsoftfp = -mno-unaligned-access >=20 > Note: the projects/clang380-import -r295601 buildworld/buildkernel = context installed on the rpi2 also has those CFLAGS entries. >=20 > Other context: >=20 >> # svnlite info /usr/ports >> Path: /usr/ports >> Working Copy Root Path: /usr/ports >> URL: https://svn0.us-west.freebsd.org/ports/head >> Relative URL: ^/head >> Repository Root: https://svn0.us-west.freebsd.org/ports >> Repository UUID: 35697150-7ecd-e111-bb59-0022644237b5 >> Revision: 408706 >> Node Kind: directory >> Schedule: normal >> Last Changed Author: danilo >> Last Changed Rev: 408706 >> Last Changed Date: 2016-02-11 23:50:55 +0000 (Thu, 11 Feb 2016) >=20 >> # freebsd-version -ku; uname -aKU >> 11.0-CURRENT >> 11.0-CURRENT >> FreeBSD rpi2 11.0-CURRENT FreeBSD 11.0-CURRENT #16 r295601M: Sun Feb = 14 01:28:43 PST 2016 = markmi@FreeBSDx64:/usr/obj/clang/arm.armv6/usr/src/sys/RPI2-NODBG arm = 1100097 1100097 I should have noted that without forcing use of = /usr/local/arm-gnueabi-freebsd/bin/ld the message is not as explicit = about -fPIC: --- liblua-5.2.so --- /usr/bin/ld: lauxlib.o(.text+0x1a50): unresolvable R_ARM_MOVW_ABS_NC = relocation against symbol `__stdinp@@FBSD_1.0' /usr/bin/ld: final link failed: Nonrepresentable section on output cc: error: linker command failed with exit code 1 (use -v to see = invocation) *** [liblua-5.2.so] Error code 1 I choose to submit based on a make.conf that forced use of = /usr/local/arm-gnueabi-freebsd/bin/ tools in order to get the more = explicit error message into the submittal. =3D=3D=3D Mark Millard markmi at dsl-only.net