pkgsrc-Users archive

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

Re: pkgsrc on AIX 7.1



I've attached the patches.  They cause a problem when building gcc, so
if you want to build gcc from pkgsrc, do that before applying the
patches.  You should use gcc5.  While gcc48 and gcc49 will build and
install, the c++ compiler doesn't work correctly, so there are some
packages you won't be able to build.

To apply the patches, cd to /path/to/pkgsrc/mk/wrapper, and then do:

patch < /path/to/patch1
patch < /path/to/patch2

If you're going to use an external gcc, then I think you'll need to
add these lines to mk.conf.  Change "/opt/freeware/lib" to whatever
directory has your gcc's libgcc_s.a.

BUILDLINK_PASSTHRU_RPATHDIRS+=  /opt/freeware/lib
LDFLAGS+=                       -Wl,-R/opt/freeware/lib



On Tue, Mar 8, 2016 at 10:57 AM, Rodrigo Garcia <rgarcia%inmegen.gob.mx@localhost> wrote:
> Hi!
>
> I tried downloading the patches: I get error 404. Are they somewhere else?
> thanks!
>
> Rodrigo
>
Index: bsd.wrapper.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/wrapper/bsd.wrapper.mk,v
retrieving revision 1.93
diff -u -r1.93 bsd.wrapper.mk
--- bsd.wrapper.mk	27 Apr 2015 19:59:07 -0000	1.93
+++ bsd.wrapper.mk	13 Feb 2016 06:48:55 -0000
@@ -311,6 +311,10 @@
 .if !empty(PKGSRC_COMPILER:Mgcc)
 _WRAP_TRANSFORM.CC=	${WRAPPER_TMPDIR}/transform-gcc
 _WRAP_TRANSFORM.CXX=	${_WRAP_TRANSFORM.CC}
+.  if ${OPSYS} == "AIX"
+_WRAP_CMD_SINK.CC=	${WRAPPER_TMPDIR}/cmd-sink-aix-gcc
+_WRAP_CMD_SINK.CXX=	${_WRAP_CMD_SINK.CC}
+.  endif
 .endif
 
 _WRAP_CMD_SINK.LD=		${WRAPPER_TMPDIR}/cmd-sink-ld
@@ -505,6 +509,7 @@
 	arg-pp-mipspro-cc \
 	arg-pp-sunpro-cxx \
 	cmd-sink-aix-cc \
+	cmd-sink-aix-gcc \
 	cmd-sink-aix-ld \
 	cmd-sink-aix-xlc \
 	cmd-sink-darwin-xlc \
Index: cmd-sink-aix-gcc
===================================================================
RCS file: cmd-sink-aix-gcc
diff -N cmd-sink-aix-gcc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ cmd-sink-aix-gcc	13 Feb 2016 06:48:55 -0000
@@ -0,0 +1,111 @@
+# $NetBSD: cmd-sink-aix-gcc,v 1.9 2009/06/11 10:38:28 sno Exp $
+#
+# Copyright (c) 2005 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Grant Beattie.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+#    must display the following acknowledgement:
+#        This product includes software developed by the NetBSD
+#        Foundation, Inc. and its contributors.
+# 4. Neither the name of The NetBSD Foundation nor the names of its
+#    contributors may be used to endorse or promote products derived
+#    from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+# Empty out the command buffer and build up the command line in $cmd.
+blibpath=
+orig_blibpath=
+dynamic=
+
+while ! queue_is_empty cmdbuf; do
+	pop_queue cmdbuf arg
+	$debug_log $wrapperlog "    (cmd-sink-aix-gcc) pop:  $arg"
+	case $arg in
+	-blibpath:*)
+		orig_blibpath=${arg#-blibpath:}
+		$debug_log $wrapperlog "    (cmd-sink-aix-gcc) drop: $dir [setting orig_blibpath]"
+		dynamic=yes
+		;;
+	-Wl,-blibpath:*)
+		orig_blibpath=${arg#-Wl,-blibpath:}
+		$debug_log $wrapperlog "    (cmd-sink-aix-gcc) drop: $dir [setting orig_blibpath]"
+		dynamic=yes
+		;;
+	##############################################################
+	# AIX ld(1) doesn't support -Wl,-rpath,* but accumulate them
+	# into a path collection we can later append to command line
+	# using -blibpath.
+	##############################################################
+	-R*|-Wl,-R*|-Wl,-rpath,*|-Wl,-rpath-link,*|-Wl,--rpath,*)
+		case $arg in
+		-R*)			R="-R" ;;
+		-Wl,-R*)		R="-Wl,-R" ;;
+		-Wl,-rpath,*)		R="-Wl,-rpath," ;;
+		-Wl,-rpath-link,*)	R="-Wl,-rpath-link," ;;
+		-Wl,--rpath,*)		R="-Wl,--rpath," ;;
+		esac
+		dir="${arg#$R}"
+		case "$blibpath" in
+		"")	blibpath="$dir" ;;
+		*)	blibpath="$blibpath:$dir" ;;
+		esac
+		$debug_log $wrapperlog "    (cmd-sink-aix-gcc) drop: $dir [adding to blibpath]"
+		dynamic=yes
+		;;
+	-rpath)
+		pop_queue cmdbuf dir
+		case $blibpath in
+		"")	blibpath="$dir" ;;
+		*)	blibpath="$blibpath:$dir" ;;
+		esac
+		$debug_log $wrapperlog "    (cmd-sink-aix-gcc) drop: $dir [adding to blibpath]"
+		;;
+	*)
+		. $buildcmd
+		;;
+	esac
+done
+
+# AIX ld(1) uses -blibpath to set the runtime library search path.
+arg="/usr/lib:/lib"
+if $test -n "$orig_blibpath"; then
+	arg="$orig_blibpath:$arg"
+fi
+if $test -n "$blibpath"; then
+        arg="$blibpath:$arg"
+fi
+arg="-Wl,-blibpath:$arg"
+$debug_log $wrapperlog "    (cmd-sink-aix-gcc) pop: $arg"
+. $buildcmd
+
+# If we are dynamically linking, make sure the runtime linker is used.
+if $test -n "$dynamic"; then
+	arg=-Wl,-brtl
+	$debug_log $wrapperlog "    (cmd-sink-aix-gcc) pop: $arg"
+	. $buildcmd
+	arg=-Wl,-bdynamic
+	$debug_log $wrapperlog "    (cmd-sink-aix-gcc) pop: $arg"
+	. $buildcmd
+fi
Index: cmd-sink-aix-ld
===================================================================
RCS file: /cvsroot/pkgsrc/mk/wrapper/cmd-sink-aix-ld,v
retrieving revision 1.5
diff -u -r1.5 cmd-sink-aix-ld
--- cmd-sink-aix-ld	15 Jan 2009 16:55:33 -0000	1.5
+++ cmd-sink-aix-ld	12 Feb 2016 08:57:37 -0000
@@ -79,13 +79,14 @@
 done
 
 # AIX ld(1) uses -blibpath to set the runtime library search path.
-arg="-blibpath:/usr/lib:/lib"
+arg="/usr/lib:/lib"
 if $test -n "$orig_blibpath"; then
-	arg="$arg:$orig_blibpath"
+	arg="$orig_blibpath:$arg"
 fi
 if $test -n "$blibpath"; then
-	arg="$arg:$blibpath"
+	arg="$blibpath:$arg"
 fi
+arg="-blibpath:$arg"
 $debug_log $wrapperlog "    (cmd-sink-aix-ld) pop: $arg"
 . $buildcmd
 


Home | Main Index | Thread Index | Old Index