From owner-freebsd-arm@freebsd.org Sat Oct 7 18:59:28 2017 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 A3CAEE3F330 for ; Sat, 7 Oct 2017 18:59:28 +0000 (UTC) (envelope-from guyyur@gmail.com) Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B2AC80C2E for ; Sat, 7 Oct 2017 18:59:27 +0000 (UTC) (envelope-from guyyur@gmail.com) Received: by mail-wm0-x234.google.com with SMTP id q132so14414568wmd.2 for ; Sat, 07 Oct 2017 11:59:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=GBxG7supTjnQpB05mjsxe5ZoSZv103hjzHskx0C3LA8=; b=Wgcni99LJzmXBS/6SIflPL8K/Kt7uvnRWQuocJnPzXUG4rH2re0CnoAeiwoB5m6IMh MHR6ykhVeISfDz5NyCDF9D1/hcyNXXBQQkJCLeT9d5BXSQM16hgoKclNsq9C3OXh1JG5 Fcm2SfIAbwytWIITOwz8UmuY8ekJmLo140LrPnrtTcbiM5OKVV3+GTZ/xaZZ50ESRVC8 5rVrp6iTIKa/OEGNA2+jUkjdRhcDN+Fm3T9vj95jLj6NJzRL+5pCW87lD059m5YqhT0C uAlN1+apS6gpvlr8vcgag3u4mA5pI8K9Dk+DeBo2D9XUM1+syG2z4QN3Lk/eOvo7wK4h OPVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=GBxG7supTjnQpB05mjsxe5ZoSZv103hjzHskx0C3LA8=; b=srRsdTLWeoNLmimgJD9pA69BaCa2W1ETAcRIbkKmUCGqkrgBv5kBSLn2LQXMAKScST FodHhlLbBjpYdZdoKRspSotLS0ixUHFS3P3+rs/MzVq+iCDUHi4aBNwV/kHddNE3oU9D ixFc77sMoh1v4fjxwEUpzO71DIhMw6jXwY4+WZnUOFiNb7BxDVn0hzKTawn0hc1h5wdT OGMtHKeAE53b4germwEWDXJ+5ATaPDACuSh5weT6y1+LLeXTP0YKh8qYSQyRWrsLyKf7 3/4onl+WtVzgPgwWPuSftULQU2yYhD6GZzs6j+mY7njsUpQbNgvjq5cOYW0ZFbW3BGrT gtYA== X-Gm-Message-State: AMCzsaXgZYojF4vT74boGceqjwOWsLnzoefz+/XgYrAwc5gc7dVuzPAV Gk+bJc/8liza0EVuwfnSAJjeMFfBpSlP9Ovy9e2XH4+f X-Google-Smtp-Source: AOwi7QCikF7HQT0VnWzcHp3jTbPapfkdauA5xECn1C0QT5My4w0aeqeIYx2CxIUDpnT5Gr7I7+IjrebXIPayCOwEn7M= X-Received: by 10.28.210.5 with SMTP id j5mr4441051wmg.15.1507402766230; Sat, 07 Oct 2017 11:59:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.197.141 with HTTP; Sat, 7 Oct 2017 11:59:25 -0700 (PDT) In-Reply-To: References: From: Guy Yur Date: Sat, 7 Oct 2017 21:59:25 +0300 Message-ID: Subject: Re: armv7, building p7zip and -fPIC To: Warner Losh Cc: freebsd-arm Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Oct 2017 18:59:28 -0000 On 7 October 2017 at 21:40, Warner Losh wrote: > > > On Sat, Oct 7, 2017 at 11:24 AM, Guy Yur wrote: >> >> Hi, >> >> Does armv7 need -fPIC when compiling? >> >> Building archivers/p7zip fails with: >> /usr/bin/ld: 7zEncode.o(.text+0x2d04): unresolvable R_ARM_MOVW_ABS_NC >> relocation against symbol `_ZTIi@@CXXABI_1.3' >> /usr/bin/ld: final link failed: Nonrepresentable section on output >> c++: error: linker command failed with exit code 1 (use -v to see >> invocation) >> *** [../../../../bin/7z.so] Error code 1 >> >> make[3]: stopped in >> >> /usr/wrkdir/usr/ports/archivers/p7zip/work/p7zip_16.02/CPP/7zip/Bundles/Format7zFree >> 1 error >> >> If I add "CFLAGS_armv7= -fPIC" in the port Makefile it builds fine. >> The port has -fPIC for aarch64, amd64, powerpc and sparc64. >> >> Is it a difference from armv6? >> When I previously built for armv6 it worked without the option. > > > armv7 is new in FreeBSD (two days old), and maybe you are tripping over > something inside the port that optimized for it? Is there a > CFLAGS+armv6=-fPIC? I don't see it with a quick grep, but you never know... > If that's what it takes to fix it, maybe you should submit that to the port > maintainer? > > Warner Hi, Seems to indeed be a difference between armv6 and armv7, found this: https://bugs.launchpad.net/ubuntu/+source/gcc-4.4/+bug/503448 I will submit a patch to the port maintainer to add CFLAGS for armv7. Thanks, Guy