From owner-freebsd-x11@FreeBSD.ORG Mon Jun 7 10:53:27 2010 Return-Path: Delivered-To: x11@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4875F1065679 for ; Mon, 7 Jun 2010 10:53:27 +0000 (UTC) (envelope-from avg@pautina.in.ua) Received: from smtp.pautina-nau.net (smtp.pautina-nau.net [194.0.89.243]) by mx1.freebsd.org (Postfix) with ESMTP id 03C458FC22 for ; Mon, 7 Jun 2010 10:53:26 +0000 (UTC) Received: from [92.249.64.71] (helo=trant.local.) by smtp.pautina-nau.net with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1OLZZB-00022c-BP; Mon, 07 Jun 2010 13:28:25 +0300 Received: from trant.local. (localhost [127.0.0.1]) by trant.local. (8.14.4/8.14.4) with ESMTP id o57ASNFs041662; Mon, 7 Jun 2010 13:28:23 +0300 (EEST) (envelope-from avg@trant.local) Received: (from root@localhost) by trant.local. (8.14.4/8.14.4/Submit) id o57ASNjr041661; Mon, 7 Jun 2010 13:28:23 +0300 (EEST) (envelope-from avg) Date: Mon, 7 Jun 2010 13:28:23 +0300 (EEST) Message-Id: <201006071028.o57ASNjr041661@trant.local.> To: FreeBSD-gnats-submit@freebsd.org From: Andriy Gapon X-send-pr-version: 3.113 X-GNATS-Notify: X-Remote-Sender-IP: 92.249.64.71 X-Remote-Sender-User: unknown Cc: x11@freebsd.org Subject: [PATCH][Mesa] graphics/libGL: fix linking with newer gcc and binutils X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2010 10:53:27 -0000 >Submitter-Id: current-users >Originator: Andriy Gapon >Organization: >Confidential: no >Synopsis: [PATCH][Mesa] graphics/libGL: fix linking with newer gcc and binutils >Severity: non-critical >Priority: low >Category: ports >Class: change-request >Release: FreeBSD 9.0-CURRENT amd64 >Environment: gcc-4.4.5.20100518 binutils-2.20.1_2 >Description: When CC is set to be gcc44 build of Mesa ports fails with: relocation R_X86_64_PC32 against symbol `_gl_DispatchTSD' can not be used when making a shared object; recompile with -fPIC This happens despite compilation being done with -fPIC already. I am not sure about the theory on why this happens, but it seems to be related to symbols visibility and -Bsymbolic linker option has been suggested as a work-around or fix. Indeed, that option is used for GNU/Linux build of Mesa and it does indeed fix linking with gcc44 on FreeBSD. Also, see this: http://lists.freedesktop.org/archives/mesa-commit/2009-June/010029.html Note that this PR is applicable to all Mesa ports, I tested it with the following: graphics/libGL graphics/libGLU graphics/libglut graphics/dri Added file(s): - files/patch-bin_mklib Port maintainer (x11@FreeBSD.org) is cc'd. Generated with FreeBSD Port Tools 0.99 Patchfile is created with update-patches target. >How-To-Repeat: >Fix: --- libGL-7.6.1.patch begins here --- diff -ruN --exclude=CVS /usr/ports/graphics/libGL.orig/files/patch-bin_mklib /usr/ports/graphics/libGL/files/patch-bin_mklib --- /usr/ports/graphics/libGL.orig/files/patch-bin_mklib 1970-01-01 03:00:00.000000000 +0300 +++ /usr/ports/graphics/libGL/files/patch-bin_mklib 2010-06-07 13:09:15.081554682 +0300 @@ -0,0 +1,11 @@ +--- bin/mklib.orig 2010-06-07 12:59:34.051442949 +0300 ++++ bin/mklib 2010-06-07 13:06:23.985952856 +0300 +@@ -497,7 +498,7 @@ case $ARCH in + FINAL_LIBS=${STLIB} + else + SHLIB="lib${LIBNAME}.so.${MAJOR}" +- OPTS="-shared -Wl,-soname,${SHLIB}" ++ OPTS="-shared -Wl,-Bsymbolic -Wl,-soname,${SHLIB}" + if [ "${ALTOPTS}" ] ; then + OPTS=${ALTOPTS} + fi --- libGL-7.6.1.patch ends here ---