From owner-freebsd-arm@FreeBSD.ORG Sat Jul 12 19:44:06 2014 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33459204 for ; Sat, 12 Jul 2014 19:44:06 +0000 (UTC) Received: from eu1sys200aog101.obsmtp.com (eu1sys200aog101.obsmtp.com [207.126.144.111]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86A282E22 for ; Sat, 12 Jul 2014 19:44:04 +0000 (UTC) Received: from mail-wi0-f175.google.com ([209.85.212.175]) (using TLSv1) by eu1sys200aob101.postini.com ([207.126.147.11]) with SMTP ID DSNKU8GP5ExAJ6HhlpwuY4lroT9yrN+eYWfp@postini.com; Sat, 12 Jul 2014 19:44:05 UTC Received: by mail-wi0-f175.google.com with SMTP id ho1so789765wib.8 for ; Sat, 12 Jul 2014 12:43:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:message-id:to:subject:reply-to :in-reply-to; bh=Ei9i8POd+CENLlTIZRUGUSirFK7n8fyUtXxl9qgq9Xc=; b=R0XvFfrh1YPmCN833Uf1lLRnhamhg+ao6YDL07BZ2asm5w4ZNAJQ2q7ibq0w0d/LsA vTSgN6tZC2Q/2U5Z/uZn0kis2FCAS3eS5Ec5rjkVG25a+ol87Rn8Ldvuzyt6Af4gDfPV ijnQFgaM8eYsdhd97gTLfLK0FyBrjiJIHlr2VEBeGjR68D9ikJv0I+s9KoSS/9EygT57 AYzTivNQNg6ISU6avo8fAsWWlQbxzjwxMBUC0QoE0n2uIK6qUjDBTC8rTsX1HH4so1cq ugx2soN351BweAhcjm1SAqhjgXM2Bvm68mtMBDDah6/I3iMuwwEtApZ1rvyPxXSRchvC FuQA== X-Gm-Message-State: ALoCoQlEWMxlshvRxtjVeAi5JfT74qlm9+pJRJMyA9L3Zr/hezqPK25Jk7W3q0cBL7gd0jBZTq8KIVsfiEfwSk6aYafRASCCL2jbLcLZMTpHx0Rdje0o55XKxWaxncl/QnYdd4LKNXtA X-Received: by 10.194.185.238 with SMTP id ff14mr8231040wjc.9.1405194212191; Sat, 12 Jul 2014 12:43:32 -0700 (PDT) X-Received: by 10.194.185.238 with SMTP id ff14mr8231037wjc.9.1405194212115; Sat, 12 Jul 2014 12:43:32 -0700 (PDT) Received: from mech-cluster241.men.bris.ac.uk (mech-cluster241.men.bris.ac.uk. [137.222.187.241]) by mx.google.com with ESMTPSA id nc19sm10044098wic.4.2014.07.12.12.43.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 Jul 2014 12:43:31 -0700 (PDT) Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1]) by mech-cluster241.men.bris.ac.uk (8.14.8/8.14.8) with ESMTP id s6CJhUUl097910 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 12 Jul 2014 20:43:30 +0100 (BST) (envelope-from mexas@mech-cluster241.men.bris.ac.uk) Received: (from mexas@localhost) by mech-cluster241.men.bris.ac.uk (8.14.8/8.14.8/Submit) id s6CJhT2p097909; Sat, 12 Jul 2014 20:43:29 +0100 (BST) (envelope-from mexas) Date: Sat, 12 Jul 2014 20:43:29 +0100 (BST) From: Anton Shterenlikht Message-Id: <201407121943.s6CJhT2p097909@mech-cluster241.men.bris.ac.uk> To: freebsd-arm@freebsd.org, george+freebsd@m5p.com Subject: Re: [Bug 175605] devel/binutils: please fix build binutils-2.23.1 in raspberry pi Reply-To: mexas@bris.ac.uk In-Reply-To: <53C07E6B.9040303@m5p.com> X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jul 2014 19:44:06 -0000 >> --- Comment #6 from mexas@bris.ac.uk --- >> Forgot to say that this was with Andreas Tobler's patchset. >> Also, it segfaults with the OS default ld too: >> >> $ cat z.c >> #include >> int main(int argc, char **argv) >> { >> printf("mumu\n"); >> return 0; >> } >> $ cc -c z.c -Wall >> $ /usr/local/bin/ld -o z /usr/lib/crt1.o /usr/lib/crti.o z.o -lc >> $ ldd z >> z: >> libc.so.7 => /lib/libc.so.7 (0x2003c000) >> $ file z >> z: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses >> shared libs), for FreBSD 10.0 (1000710), not stripped >> $ ./z >> Segmentation fault (core dumped) >> $ /usr/bin/ld -o z /usr/lib/crt1.o /usr/lib/crti.o z.o -lc >> $ ldd z >> z: >> libc.so.7 => /lib/libc.so.7 (0x2003c000) >> $ file z >> z: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses >> shared libs), for FreBSD 10.0 (1000710), not stripped >> $ ./z >> Segmentation fault (core dumped) >> $ >> >Why are you using this strange invocation of the linker? If I run >"cc -v -o z z.c", here is how it invokes ld: > > "/usr/bin/ld" --eh-frame-hdr -dynamic-linker /libexec/ld-elf.so.1 >--hash-style=both --enable-new-dtags -o z /usr/lib/crt1.o >/usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/lib /tmp/z-9530c3.o -lgcc >--as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s >--no-as-needed /usr/lib/crtend.o /usr/lib/crtn.o > >The resulting program runs without difficulty. -- George well, I copied my invocation from: http://people.freebsd.org/~rene/patches/binutils-rpi-bug.txt but you are right. I have now did just the same using /usr/local/bin/ld, and the executable worked. So probably Andreas Tobler's patchset should be committed? I'm building lang/gcc right now, will see how it goes. Anton