From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Aug 26 18:40:04 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F3F741065678 for ; Sun, 26 Aug 2012 18:40:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id C245A8FC17 for ; Sun, 26 Aug 2012 18:40:03 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q7QIe3ot047197 for ; Sun, 26 Aug 2012 18:40:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q7QIe3Y9047196; Sun, 26 Aug 2012 18:40:03 GMT (envelope-from gnats) Resent-Date: Sun, 26 Aug 2012 18:40:03 GMT Resent-Message-Id: <201208261840.q7QIe3Y9047196@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Tijl Coosemans Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB1F6106564A for ; Sun, 26 Aug 2012 18:33:19 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay008.isp.belgacom.be (mailrelay008.isp.belgacom.be [195.238.6.174]) by mx1.freebsd.org (Postfix) with ESMTP id 397DE8FC0C for ; Sun, 26 Aug 2012 18:33:18 +0000 (UTC) Received: from 216.81-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.81.216]) by relay.skynet.be with ESMTP; 26 Aug 2012 20:32:10 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.5/8.14.5) with ESMTP id q7QIW9ds010022 for ; Sun, 26 Aug 2012 20:32:09 +0200 (CEST) (envelope-from tijl@kalimero.tijl.coosemans.org) Received: (from tijl@localhost) by kalimero.tijl.coosemans.org (8.14.5/8.14.5/Submit) id q7QIW87Z010021; Sun, 26 Aug 2012 20:32:09 +0200 (CEST) (envelope-from tijl) Message-Id: <201208261832.q7QIW87Z010021@kalimero.tijl.coosemans.org> Date: Sun, 26 Aug 2012 20:32:09 +0200 (CEST) From: Tijl Coosemans To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/171086: [patch] devel/gdb: various fixes X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Tijl Coosemans List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2012 18:40:04 -0000 >Number: 171086 >Category: ports >Synopsis: [patch] devel/gdb: various fixes >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Aug 26 18:40:03 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Tijl Coosemans >Release: FreeBSD 10.0-CURRENT i386 >Organization: >Environment: >Description: The attached patch fixes some issues with devel/gdb: 1) Some files are extracted with 0666 permissions which allows anyone to modify the source while building. The fix is to add --no-same-owner --no-same-permissions to EXTRACT_AFTER_ARGS like bsd.port.mk does. 2) Threading support is currently broken. When you run gdb it prints an error that says it failed to load libthread_db.so because it cannot resolve ps_pread. This function is defined in fbsd-threads.c and gdb has to be linked with -Wl,-E to export it. This flag used to be added by patch-gdb-Makefile.in, but that has been removed in the update to gdb 7.5. I've added it back to extra-patch-gdb-Makefile.in. 3) Threading support on FreeBSD/i386 10-CURRENT is currently broken because two configure tests that test existence of r_fs and r_gs fields in struct reg fail. This causes gdb to overwrite %fs and %gs registers with zero which makes threaded programs crash. The tests are missing sys/types.h as a prerequisite header. (The test for the existence of struct reg itself already uses sys/types.h, so I simply copied that.) >How-To-Repeat: >Fix: --- gdb.patch begins here --- diff -urN /usr/ports/devel/gdb/Makefile ./Makefile --- /usr/ports/devel/gdb/Makefile 2012-08-24 04:54:50.000000000 +0200 +++ ./Makefile 2012-08-26 20:16:49.000000000 +0200 @@ -7,6 +7,7 @@ PORTNAME= gdb PORTVERSION= 7.5 +PORTREVISION= 1 CATEGORIES= devel MASTER_SITES= GNU @@ -30,7 +31,8 @@ CFLAGS:= ${CFLAGS:C/ +$//} # blanks at EOL creep in sometimes CFLAGS+= -DRL_NO_COMPAT EXCLUDE= dejagnu expect readline sim texinfo intl -EXTRACT_AFTER_ARGS=| ${TAR} -xf - ${EXCLUDE:S/^/--exclude /} +EXTRACT_AFTER_ARGS= | ${TAR} -xf - ${EXCLUDE:S/^/--exclude /} \ + --no-same-owner --no-same-permissions VER= ${PORTVERSION:S/.//g} PLIST_SUB= VER=${VER} MAN1= gdb${VER}.1 diff -urN /usr/ports/devel/gdb/files/extrapatch-gdb-Makefile.in ./files/extrapatch-gdb-Makefile.in --- /usr/ports/devel/gdb/files/extrapatch-gdb-Makefile.in 2012-08-24 04:54:50.000000000 +0200 +++ ./files/extrapatch-gdb-Makefile.in 2012-08-26 18:40:22.000000000 +0200 @@ -18,6 +18,15 @@ mdebugread.h m88k-tdep.h stabsread.h hppa-linux-offsets.h linux-fork.h \ ser-unix.h inf-ptrace.h terminal.h ui-out.h frame-base.h \ f-lang.h dwarf2loc.h value.h sparc-tdep.h defs.h target-descriptions.h \ +@@ -1164,7 +1164,7 @@ + # Removing the old gdb first works better if it is running, at least on SunOS. + gdb$(EXEEXT): gdb.o $(LIBGDB_OBS) $(ADD_DEPS) $(CDEPS) $(TDEPLIBS) + rm -f gdb$(EXEEXT) +- $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \ ++ $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) -Wl,-E \ + -o gdb$(EXEEXT) gdb.o $(LIBGDB_OBS) \ + $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES) + @@ -1429,7 +1429,7 @@ armnbsd-nat.c armbsd-tdep.c armnbsd-tdep.c armobsd-tdep.c \ avr-tdep.c \ diff -urN /usr/ports/devel/gdb/files/patch-gdb-configure ./files/patch-gdb-configure --- /usr/ports/devel/gdb/files/patch-gdb-configure 1970-01-01 01:00:00.000000000 +0100 +++ ./files/patch-gdb-configure 2012-08-24 14:06:02.000000000 +0200 @@ -0,0 +1,22 @@ +--- gdb/configure.orig 2012-08-24 14:03:52.000000000 +0200 ++++ gdb/configure 2012-08-24 14:05:06.000000000 +0200 +@@ -10590,7 +10590,8 @@ + + # See if supports the %fs and %gs i386 segment registers. + # Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'. +-ac_fn_c_check_member "$LINENO" "struct reg" "r_fs" "ac_cv_member_struct_reg_r_fs" "#include ++ac_fn_c_check_member "$LINENO" "struct reg" "r_fs" "ac_cv_member_struct_reg_r_fs" "#include ++#include + " + if test "x$ac_cv_member_struct_reg_r_fs" = x""yes; then : + +@@ -10600,7 +10601,8 @@ + + + fi +-ac_fn_c_check_member "$LINENO" "struct reg" "r_gs" "ac_cv_member_struct_reg_r_gs" "#include ++ac_fn_c_check_member "$LINENO" "struct reg" "r_gs" "ac_cv_member_struct_reg_r_gs" "#include ++#include + " + if test "x$ac_cv_member_struct_reg_r_gs" = x""yes; then : + --- gdb.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: