From 4982d4ebc3bd4924d73f2f2ad584309e9ec97435 Mon Sep 17 00:00:00 2001 From: Ben Huntsman Date: Mon, 4 May 2020 19:52:02 -0700 Subject: all: update build scripts to fix AIX XL/C compatibility --- bin/9c | 19 ++++++++++++++++++- bin/9l | 13 +++++++------ 2 files changed, 25 insertions(+), 7 deletions(-) (limited to 'bin') diff --git a/bin/9c b/bin/9c index 0f836d24..320a1634 100755 --- a/bin/9c +++ b/bin/9c @@ -82,6 +82,23 @@ useclang() cflags="$ngflags -g" } +usexlc() +{ + cc=${CC9:-xlc_r} + ngflags=" \ + -c \ + -O0 \ + -qmaxmem=-1 \ + -qsuppress=1506-236 \ + -qsuppress=1506-358 \ + -qsuppress=1500-010 \ + -qsuppress=1506-224 \ + -qsuppress=1506-1300 \ + -qsuppress=1506-342 \ + " + cflags="$ngflags -g -qfullpath" +} + tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}-${CC9:-cc}" case "$tag" in *DragonFly*gcc*|*BSD*gcc*) usegcc ;; @@ -120,7 +137,7 @@ case "$tag" in cflags="$ngflags -g" cflags="$cflags -D__sun__ -D__${s}__" ;; -*AIX*) usegcc +*AIX*) usexlc cflags="$ngflags -g -D__AIX__" ;; *) diff --git a/bin/9l b/bin/9l index a10aab72..398adbd8 100755 --- a/bin/9l +++ b/bin/9l @@ -61,8 +61,9 @@ case "$tag" in esac ;; *AIX*) - ld=${CC9:-gcc} - nmflags="-B" + ld="${CC9:-xlc_r} -g -O0" + nmflags="-A -B" + extralibs="$extralibs -lpthread" ;; *) echo do not know how to link on "$tag" 1>&2 @@ -113,8 +114,8 @@ then then a=` nm $nmflags $ofiles | - grep '__p9l_autolib_[a-zA-Z0-9+-]*$' | - sed 's/.*__p9l_autolib_//' | + grep '__p9l_autolib_[a-zA-Z0-9+-]*' | + sed 's/.*__p9l_autolib_//; s/:.*//' | sort -u ` for i in $a @@ -144,8 +145,8 @@ then do b=` nm $lpath/lib$i.a 2>/dev/null | - grep '__p9l_autolib_[a-zA-Z0-9+-]*$' | - sed 's/.*__p9l_autolib_//' | + grep '__p9l_autolib_[a-zA-Z0-9+-]*' | + sed 's/.*__p9l_autolib_//; s/:.*//' | sort -u | egrep -v '^(thread|draw)$' ` -- cgit v1.2.3