From owner-freebsd-mono@FreeBSD.ORG Fri Jun 20 17:12:47 2014 Return-Path: Delivered-To: mono@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 F3EE4F3 for ; Fri, 20 Jun 2014 17:12:46 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (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 C1EC1266F for ; Fri, 20 Jun 2014 17:12:46 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.8/8.14.8) with ESMTP id s5KHCkeW064136 for ; Fri, 20 Jun 2014 18:12:46 +0100 (BST) (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: mono@FreeBSD.org Subject: [Bug 190851] lang/mono build broken when using binutils from ports Date: Fri, 20 Jun 2014 17:12:47 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports Tree X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: z7dr6ut7gs@snkmail.com X-Bugzilla-Status: Needs Triage X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: mono@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-mono@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Mono and C# applications on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jun 2014 17:12:47 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=190851 --- Comment #3 from John Hein --- Here are some more details. Base OS is using binutils 2.17.50 (+ freebsd changes) or freebsd 8.x is using a base binutils based on 2.15. Latest port is binutils 2.24. I think the check that is causing this build failure was added to binutils in 2.21-ish time frame. See also: https://sourceware.org/bugzilla/show_bug.cgi?id=13255 Both mono/mini/ldscripts & ldscripts.mono have: . . local: *; . . Because of this when ld(1) from binutils 2.24 tries to link object files to create a binary executable, it notices that crt1.o has __progname defined and libc.so has an undefined reference to __progname. Normally this link together just fine, but via the linker script we've told it that all symbols that are not the explicitly listed global symbols are local symbols. So ld(1) refuses to resolve the libc->crt1.o dependency for __progname and spits out the 'local symbol is reference by DSO' message. I'm pondering the best way to fix this. Maybe: (1) add __progname & environ to globals list in the linker script like my previous attached patch. This is specific to platforms like freebsd that define __progname (and environ) in one object file (crt1.o) and reference it in a DSO (libc.so). (2) remove 'local: *' from the linker script used for producing programs (as opposed to shared libs) - namely mono/mini/ldscripts.mono. We don't really care whether symbols are marked global or local in the executable images, just the shared libs. (3) modify Makefile.am (&/or Makefile.in for the mono port since lang/mono doesn't currently re-run the auto* tools) to not use the linker script for the executables, just for the shared libs. I think I prefer (2) and that seems most likely acceptable for upstream (although I haven't opened a bug there yet). -- You are receiving this mail because: You are the assignee for the bug.