NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

xsrc/40502: build of xman fails when MKPIE=yes is specified



>Number:         40502
>Category:       xsrc
>Synopsis:       build of xman fails when MKPIE=yes is specified
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    xsrc-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 28 10:50:00 +0000 2009
>Originator:     George Abdelmalik
>Release:        5.0_RC1
>Organization:
ADS
>Environment:
NetBSD bart.fork.id.au 4.99.73 NetBSD 4.99.73 (BART) #0: Thu Oct 23 22:40:26 
EST 2008  
srcmstr%bart.fork.id.au@localhost:/vstore/netbsd-current/obj/sys/arch/amd64/compile/BART
 amd64

>Description:
When running a build.sh with MKPIE=yes in mk.conf, the build of xman
fails as follows:

#   compile  xman/handler.o
/vstore/netbsd-5/src/../tools/bin/x86_64--netbsd-gcc -O2 -fPIC -DPIC 
-fno-strict-aliasing  -fstack-protector -Wstack-protector --param 
ssp-buffer-size=1  -Werror   -DOSMAJORVERSION=1 -DOSMINORVERSION=6 
-DHAS_SNPRINTF -DHELPFILE=\"/usr/X11R7/lib/X11/xman.help\" -DHAS_MKSTEMP 
-DHAS_GROFF -DMANCONFIGSTYLE_OpenBSD -DMANCONF=\"/etc/man.conf\" -DNO_ALLOCA 
-DCSRG_BASED -DFUNCPROTO=15 -DNARROWPROTO 
-I/vstore/netbsd-5/src/../dest/usr/X11R7/include -D__AMD64__ -nostdinc -isystem 
/vstore/netbsd-5/src/../dest/usr/include   -D_FORTIFY_SOURCE=2 -c    
/vstore/netbsd-5/src/../xsrc/external/mit/xman/dist/handler.c
In file included from 
/vstore/netbsd-5/src/../xsrc/external/mit/xman/dist/handler.c:42:
/vstore/netbsd-5/src/../xsrc/external/mit/xman/dist/vendor.h:190:1: error: 
"PIC" redefined
<command line>:1:1: error: this is the location of the previous definition

*** Failed target:  handler.o
*** Failed command: /vstore/netbsd-5/src/../tools/bin/x86_64--netbsd-gcc -O2 
-fPIC -DPIC -fno-strict-aliasing -fstack-protector -Wstack-protector --param 
ssp-buffer-size=1 -Werror -DOSMAJORVERSION=1 -DOSMINORVERSION=6 -DHAS_SNPRINTF 
-DHELPFILE=\"/usr/X11R7/lib/X11/xman.help\" -DHAS_MKSTEMP -DHAS_GROFF 
-DMANCONFIGSTYLE_OpenBSD -DMANCONF=\"/etc/man.conf\" -DNO_ALLOCA -DCSRG_BASED 
-DFUNCPROTO=15 -DNARROWPROTO -I/vstore/netbsd-5/src/../dest/usr/X11R7/include 
-D__AMD64__ -nostdinc -isystem /vstore/netbsd-5/src/../dest/usr/include 
-D_FORTIFY_SOURCE=2 -c 
/vstore/netbsd-5/src/../xsrc/external/mit/xman/dist/handler.c
*** Error code 1

Problem is that xsrc/external/mit/xman/dist/vendor.h seems to define PIC for 
some other purpose which conflicts with that already defined in variable 
PIE_CFLAGS (share/mk/bsd.sys.mk:92) when MKPIE is used.



>How-To-Repeat:
Run a build.sh defining MKPIE=yes
>Fix:
My fix was to not give xman -DPIC by patching the Makefile file as follows.


Index: external/mit/xorg/bin/xman/Makefile
===================================================================
RCS file: /cvsroot/src/external/mit/xorg/bin/xman/Makefile,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 Makefile
--- external/mit/xorg/bin/xman/Makefile 29 Jul 2008 05:01:22 -0000      1.1.1.1
+++ external/mit/xorg/bin/xman/Makefile 28 Jan 2009 10:43:52 -0000
@@ -23,5 +23,11 @@
 
 .PATH: ${X11SRCDIR.${PROG}}
 
+# xsrc/external/mit/xman/dist/vendor.h line 190 seems to define PIC
+# for another purpose so define PIE_CFLAGS here without -DPIC to
+# avoid its definition in share/mk/bsd.sys.mk.
+#
+PIE_CFLAGS= -fPIC
+
 .include <bsd.x11.mk>
 .include <bsd.prog.mk>



Home | Main Index | Thread Index | Old Index