From owner-freebsd-gnome@FreeBSD.ORG Wed Jul 16 19:04:04 2014 Return-Path: Delivered-To: gnome@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B60AF8A for ; Wed, 16 Jul 2014 19:04:04 +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 2DE9C27DF for ; Wed, 16 Jul 2014 19:04:04 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.8/8.14.8) with ESMTP id s6GJ44Hc030409 for ; Wed, 16 Jul 2014 19:04:04 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: gnome@FreeBSD.org Subject: [Bug 191611] databases/evolution-data-server fails to link when rebuilding because requisite library (sqlite, Berkeley DB) changed and its /usr/local has become unusable Date: Wed, 16 Jul 2014 19:04:03 +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 Many People X-Bugzilla-Who: mandree@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: gnome@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-gnome@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: GNOME for FreeBSD -- porting and maintaining List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2014 19:04:04 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191611 --- Comment #16 from Matthias Andree --- tl;dr: 1. --allow-shlib-undefined is dangerous and can result in non-working executables. 2. Your patch drops the .a files, requiring a pkg-plist change. 3. I propose to work around this problem by patching LDCONFIG; I am attaching my proposed minimal patch. These are the relevant parts of my debugging session. Let's start at the failure. I ran the build, and re-ran it without cleaning with MAKE_JOBS_UNSAFE to single out the first failure, which is: > gmake[4]: Entering directory `/var/tmp/usr/ports.svn/databases/evolution-data-server/work/evolution-data-server-2.32.1/calendar/libedata-cal' > /bin/sh ../../libtool --tag=CC --mode=link cc -O2 -pipe -march=athlon64 -fstack-protector -DLDAP_DEPRECATED -fno-strict-aliasing -L/usr/local/lib -pthread -fstack-protector -o test-e-sexp test_e_sexp-e-cal-backend-sexp.o -lical libedata-cal-1.2.la ../../calendar/libecal/libecal-1.2.la ../../libedataserver/libedataserver-1.2.la -lxml2 -lsoup-2.4 -lgio-2.0 -lgobject-2.0 -lgconf-2 -lglib-2.0 -lintl -L/usr/local/lib -lplds4 -lplc4 -lnspr4 -pthread > libtool: link: cc -O2 -pipe -march=athlon64 -fstack-protector -DLDAP_DEPRECATED -fno-strict-aliasing -pthread -fstack-protector -o .libs/test-e-sexp test_e_sexp-e-cal-backend-sexp.o -pthread -L/usr/local/lib -lical ./.libs/libedata-cal-1.2.so ../../calendar/libecal/.libs/libecal-1.2.so ../../libedataserver/.libs/libedataserver-1.2.so /usr/local/lib/libxml2.so /usr/local/lib/libsoup-2.4.so /usr/local/lib/libgio-2.0.so /usr/local/lib/libgobject-2.0.so /usr/local/lib/libgconf-2.so /usr/local/lib/libglib-2.0.so /usr/local/lib/libintl.so -lplds4 -lplc4 -lnspr4 -pthread -Wl,-rpath -Wl,/usr/local/lib > /usr/bin/ld: warning: libdb-6.0.so, needed by /usr/local/lib/libebackend-1.2.so.0, not found (try using -rpath or -rpath-link) > /usr/local/lib/libebackend-1.2.so.0: undefined reference to `db_create' OK, so let's see who is pulling in libebackend-1.2.so.0 from $PREFIX/$LOCALBASE: > $ "/usr/bin/ld" --verbose "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld-elf.so.1" "--hash-style=both" "--enable-new-dtags" "-o" ".libs/test-e-sexp" "/usr/lib/crt1.o" "/usr/lib/crti.o" "/usr/lib/crtbegin.o" "-L/usr/local/lib" "-L/usr/lib" "-L/usr/lib" "test_e_sexp-e-cal-backend-sexp.o" "-lical" "./.libs/libedata-cal-1.2.so" "../../calendar/libecal/.libs/libecal-1.2.so" "../../libedataserver/.libs/libedataserver-1.2.so" "/usr/local/lib/libxml2.so" "/usr/local/lib/libsoup-2.4.so" "/usr/local/lib/libgio-2.0.so" "/usr/local/lib/libgobject-2.0.so" "/usr/local/lib/libgconf-2.so" "/usr/local/lib/libglib-2.0.so" "/usr/local/lib/libintl.so" "-lplds4" "-lplc4" "-lnspr4" "-rpath" "/usr/local/lib" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lpthread" "-lc" "-lssp_nonshared" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "/usr/lib/crtend.o" "/usr/lib/crtn.o" > ... > libpcre.so.3 needed by ./.libs/libedata-cal-1.2.so > found libpcre.so.3 at /usr/local/lib/libpcre.so.3 > libebackend-1.2.so.0 needed by ./.libs/libedata-cal-1.2.so > found libebackend-1.2.so.0 at /usr/local/lib/libebackend-1.2.so.0 WHOOPS! We need libebackend from $WRKSRC/libebackend/.libs/ instead! We see that the libedata-cal-1.2.so is where the trouble starts. Let's investigate it: > $ readelf -d .libs/libedata-cal-1.2.so > 0x0000000000000001 (NEEDED) Shared library: [libc.so.7] > 0x000000000000000e (SONAME) Library soname: [libedata-cal-1.2.so.10] > 0x000000000000000f (RPATH) Library rpath: [/var/tmp/usr/ports.svn/databases/evolution-data-server/work/evolution-data-server-2.32.1/calendar/libecal/.libs:/usr/local/lib:/var/tmp/usr/ports.svn/databases/evolution-data-server/work/evolution-data-server-2.32.1/libedataserver/.libs:/var/tmp/usr/ports.svn/databases/evolution-data-server/work/evolution-data-server-2.32.1/libebackend/.libs] > 0x000000000000001d (RUNPATH) Library runpath: [/var/tmp/usr/ports.svn/databases/evolution-data-server/work/evolution-data-server-2.32.1/calendar/libecal/.libs:/usr/local/lib:/var/tmp/usr/ports.svn/databases/evolution-data-server/work/evolution-data-server-2.32.1/libedataserver/.libs:/var/tmp/usr/ports.svn/databases/evolution-data-server/work/evolution-data-server-2.32.1/libebackend/.libs] And there you have it: /usr/local/lib is before the ../libebackend/.libs, and this is what screws the build. Now let's see how this broken libedata-cal-1.2.so.10 got linked; further up in the full log I see: > libtool: link: cc -shared .libs/libedata_cal_1_2_la-e-data-cal-enumtypes.o .libs/libedata_cal_1_2_la-e-cal-backend.o .libs/libedata_cal_1_2_la-e-cal-backend-cache.o .libs/libedata_cal_1_2_la-e-cal-backend-factory.o .libs/libedata_cal_1_2_la-e-cal-backend-intervaltree.o .libs/libedata_cal_1_2_la-e-cal-backend-sexp.o .libs/libedata_cal_1_2_la-e-cal-backend-sync.o .libs/libedata_cal_1_2_la-e-cal-backend-util.o .libs/libedata_cal_1_2_la-e-cal-backend-store.o .libs/libedata_cal_1_2_la-e-cal-backend-file-store.o .libs/libedata_cal_1_2_la-e-data-cal.o .libs/libedata_cal_1_2_la-e-data-cal-view.o -Wl,--whole-archive ../../calendar/libegdbus/.libs/libegdbus-cal.a -Wl,--no-whole-archive -Wl,-rpath -Wl,/var/tmp/usr/ports.svn/databases/evolution-data-server/work/evolution-data-server-2.32.1/calendar/libecal/.libs -Wl,-rpath -Wl,/usr/local/lib -Wl,-rpath -Wl,/var/tmp/usr/ports.svn/databases/evolution-data-server/work/evolution-data-server-2.32.1/libedataserver/.libs -Wl,-rpath -Wl,/var/tmp/us r/ports.svn/databases/evolution-data-server/work/evolution-data-server-2.32.1/libebackend/.libs -Wl,-rpath -Wl,/usr/local/lib -L/usr/local/lib ../../calendar/libecal/.libs/libecal-1.2.so /usr/local/lib/libgtk-x11-2.0.so /usr/local/lib/libgdk-x11-2.0.so /usr/local/lib/libpangocairo-1.0.so /usr/local/lib/libXext.so /usr/local/lib/libXrender.so /usr/local/lib/libXinerama.so /usr/local/lib/libXi.so /usr/local/lib/libXrandr.so /usr/local/lib/libXcursor.so /usr/local/lib/libXcomposite.so /usr/local/lib/libXdamage.so /usr/local/lib/libXfixes.so /usr/local/lib/libX11.so /usr/local/lib/libatk-1.0.so /usr/local/lib/libcairo.so /usr/local/lib/libgdk_pixbuf-2.0.so /usr/local/lib/libpangoft2-1.0.so /usr/local/lib/libpango-1.0.so /usr/local/lib/libfontconfig.so /usr/local/lib/libfreetype.so /usr/local/lib/libORBit-2.so /usr/local/lib/libgthread-2.0.so /usr/local/lib/libgdata.so /usr/local/lib/libsoup-2.4.so /usr/local/lib/libgmodule-2.0.so -lz /usr/local/lib/libffi.so /usr/local/lib/libiconv.so / usr/local/lib/libpcre.so ../../libedataserve! r/.libs/libedataserver-1.2.so ../../libebackend/.libs/libebackend-1.2.so /usr/local/lib/libgio-2.0.so /usr/local/lib/libgobject-2.0.so -lical -licalss -licalvcal /usr/local/lib/libxml2.so /usr/local/lib/libgconf-2.so /usr/local/lib/libglib-2.0.so /usr/local/lib/libintl.so -march=athlon64 -pthread -pthread -pthread -Wl,-soname -Wl,libedata-cal-1.2.so.10 -o .libs/libedata-cal-1.2.so.10.0.0 So what we see here is that libebackend/.libs/libebackend-1.2.so gets linked by relative path, AND there is a corresponding "-Wl,-rpath -Wl,/var/tmp/usr/ports.svn/databases/evolution-data-server/work/evolution-data-server-2.32.1/libebackend/.libs" option pair, but it is before the /usr/local/lib. That's what breaks the build with the unusable older package installed. I propose to prefix the libebackend/.libs through -rpath-link grafted early in LDFLAGS, that works for me. See the proposed newer patch. -- You are receiving this mail because: You are the assignee for the bug.