Discussion:
[ast-developers] [patch] Patch to get ast-ksh.2013-10-10 to build with PathScale C compiler...
Roland Mainz
2013-10-18 00:05:02 UTC
Permalink
Hi!

----

Attached (as "astksh20131010_pathcc_fix001.diff.txt") is a patch which
fixes the build of ast-ksh.2013-10-10 on SuSE 12.3/AMD64/64bit to work
with the PathScale C compiler (available from
http://www.pathscale.com/ekopath-compiler-suite ; note that the
download link is currently broken and returns something from 2011...
but the link can easily hacked to return a newer version like
http://c591116.r16.cf2.rackcdn.com/ekopath/nightly/Linux/ekopath-2013-10-11-installer.run).

The patch is neccesary since pathscale's C compiler produces more
verbose erro r messages which broke Mamfile library detection which
uses stuff like $ var=$(cc <options> 2>&1) ; echo '' $var # to pass
the compiler's output around. The fix is to replace $var with "$var"
...

----

Bye,
Roland
--
__ . . __
(o.\ \/ /.o) roland.mainz at nrubsig.org
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)
-------------- next part --------------
diff -r -u build_i386_64bit_debug/src/cmd/ksh93/Mamfile build_pathcc/src/cmd/ksh93/Mamfile
--- src/cmd/ksh93/Mamfile 2013-10-09 16:24:36.000000000 +0200
+++ src/cmd/ksh93/Mamfile 2013-10-18 00:57:59.917305074 +0200
@@ -63,8 +63,8 @@
exec - esac
exec - continue
exec - elif test ! -f ${INSTALLROOT}/lib/lib$i.a
-exec - then case `{ ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -L${INSTALLROOT}/lib ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' $x ;} | sed -e 's/[][()+@?]/#/g' || :` in
-exec - *$x*) case `{ ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' $x ;} | sed -e 's/[][()+@?]/#/g' || :` in
+exec - then case `{ ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -L${INSTALLROOT}/lib ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' "$x" ;} | sed -e 's/[][()+@?]/#/g' || :` in
+exec - *$x*) case `{ ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' "$x" ;} | sed -e 's/[][()+@?]/#/g' || :` in
exec - *$x*) continue ;;
exec - esac
exec - ;;
diff -r -u build_i386_64bit_debug/src/lib/libcmd/Mamfile build_pathcc/src/lib/libcmd/Mamfile
--- src/lib/libcmd/Mamfile 2013-10-09 16:24:41.000000000 +0200
+++ src/lib/libcmd/Mamfile 2013-10-18 00:57:03.192290140 +0200
@@ -59,8 +59,8 @@
exec - esac
exec - continue
exec - elif test ! -f ${INSTALLROOT}/lib/lib$i.a
-exec - then case `{ ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -L${INSTALLROOT}/lib ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' $x ;} | sed -e 's/[][()+@?]/#/g' || :` in
-exec - *$x*) case `{ ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' $x ;} | sed -e 's/[][()+@?]/#/g' || :` in
+exec - then case `{ ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -L${INSTALLROOT}/lib ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' "$x" ;} | sed -e 's/[][()+@?]/#/g' || :` in
+exec - *$x*) case `{ ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' "$x" ;} | sed -e 's/[][()+@?]/#/g' || :` in
exec - *$x*) continue ;;
exec - esac
exec - ;;
diff -r -u build_i386_64bit_debug/src/lib/libdll/Mamfile build_pathcc/src/lib/libdll/Mamfile
--- src/lib/libdll/Mamfile 2013-10-09 16:24:41.000000000 +0200
+++ src/lib/libdll/Mamfile 2013-10-17 23:44:15.406019437 +0200
@@ -59,8 +59,8 @@
exec - esac
exec - continue
exec - elif test ! -f ${INSTALLROOT}/lib/lib$i.a
-exec - then case `{ ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -L${INSTALLROOT}/lib ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' $x ;} | sed -e 's/[][()+@?]/#/g' || :` in
-exec - *$x*) case `{ ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' $x ;} | sed -e 's/[][()+@?]/#/g' || :` in
+exec - then case `{ ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -L${INSTALLROOT}/lib ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' "$x" ;} | sed -e 's/[][()+@?]/#/g' || :` in
+exec - *$x*) case `{ ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' "$x" ;} | sed -e 's/[][()+@?]/#/g' || :` in
exec - *$x*) continue ;;
exec - esac
exec - ;;
Glenn Fowler
2013-10-18 06:13:58 UTC
Permalink
nice catch roland -- this may also fix some spurious bootstrap failures
I've seen with other compilers
since Mamfiles are generated by nmake the permanent place for the fix is in
src/cmd/nmake/Makerules.mk
diff attached

once you rebuild nmake you can test it by generating new tarballs

package only write base source version=YYYY-MM-DD INIT ast-ksh

the tarballs will be in $PACKAGEROOT/lib/package/tgz
Post by Roland Mainz
Hi!
----
Attached (as "astksh20131010_pathcc_fix001.diff.txt") is a patch which
fixes the build of ast-ksh.2013-10-10 on SuSE 12.3/AMD64/64bit to work
with the PathScale C compiler (available from
http://www.pathscale.com/ekopath-compiler-suite ; note that the
download link is currently broken and returns something from 2011...
but the link can easily hacked to return a newer version like
http://c591116.r16.cf2.rackcdn.com/ekopath/nightly/Linux/ekopath-2013-10-11-installer.run
).
The patch is neccesary since pathscale's C compiler produces more
verbose erro r messages which broke Mamfile library detection which
uses stuff like $ var=$(cc <options> 2>&1) ; echo '' $var # to pass
the compiler's output around. The fix is to replace $var with "$var"
...
----
Bye,
Roland
--
__ . . __
(o.\ \/ /.o) roland.mainz at nrubsig.org
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.research.att.com/pipermail/ast-developers/attachments/20131018/75663abd/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t
Type: application/octet-stream
Size: 1350 bytes
Desc: not available
URL: <http://lists.research.att.com/pipermail/ast-developers/attachments/20131018/75663abd/attachment.obj>
Cedric Blancher
2013-10-18 10:35:13 UTC
Permalink
nice catch roland -- this may also fix some spurious bootstrap failures I've
seen with other compilers
since Mamfiles are generated by nmake the permanent place for the fix is in
src/cmd/nmake/Makerules.mk
diff attached
once you rebuild nmake you can test it by generating new tarballs
package only write base source version=YYYY-MM-DD INIT ast-ksh
the tarballs will be in $PACKAGEROOT/lib/package/tgz
Doesn't it make more sense to abandon use of echo(1legacy) and use
printf(1posix) instead? Is there any platform left which doesn't have
/usr/bin/printf

Ced
--
Cedric Blancher <cedric.blancher at gmail.com>
Institute Pasteur
Cedric Blancher
2013-10-18 11:05:13 UTC
Permalink
nice catch roland -- this may also fix some spurious bootstrap failures I've
seen with other compilers
since Mamfiles are generated by nmake the permanent place for the fix is in
src/cmd/nmake/Makerules.mk
diff attached
OT: Can nmake be used as POSIX make?

Ced
--
Cedric Blancher <cedric.blancher at gmail.com>
Institute Pasteur
Glenn Fowler
2013-10-19 14:26:05 UTC
Permalink
in this instance it was coder error (me) not quoting correctly
as long as echo is doing the job there is no need to change
especially in parts of the code that absolutely must be portable
in addition changing from echo to printf is not as easy as %s/echo/printf/g
just about *every* instance of it would have to be manually grokked and
edited


On Fri, Oct 18, 2013 at 7:05 AM, Cedric Blancher
Post by Cedric Blancher
Post by Glenn Fowler
nice catch roland -- this may also fix some spurious bootstrap failures
I've
Post by Glenn Fowler
seen with other compilers
since Mamfiles are generated by nmake the permanent place for the fix is
in
Post by Glenn Fowler
src/cmd/nmake/Makerules.mk
diff attached
OT: Can nmake be used as POSIX make?
Ced
--
Cedric Blancher <cedric.blancher at gmail.com>
Institute Pasteur
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.research.att.com/pipermail/ast-developers/attachments/20131019/12eeee30/attachment.html>
Glenn Fowler
2013-10-19 14:26:47 UTC
Permalink
I'd prefer that nmake were more NOT (not off topic) on this list

nmake is not backwards compatible with posix make
that was intentional so that from the ground up nmake could make the right
choices about each item
although the one thing nmake could not shake is the significance of <TAB>
indentation

the best way to get familiar with nmake is to start using it in the
ast-open $INSTALLROOT/src tree
immediately after the first "bin/package make" works

bin/package use

cd $INSTALLROOT/src

nmake install # builds the entire src tree *in proper order*

cd lib

nmake install # builds the entire src/lib tree *in proper order*

cd libcmd

nmake install # builds just libcmd

and especially use it if you are debugging a particular subset of ast

use just about any ast Makefile except { libast 3d ksh93 } as a boilerplate
example
the 3 mentioned aren't bad per-se but they are involved a bit more than the
rest
for project style makefiles you should be familiar with

:PACKAGE:
::

:LIBRARY:

name == value

-lfoo as prerequisite, not libfoo.a or libfoo.so or foo.dll or foo.lib



On Fri, Oct 18, 2013 at 7:05 AM, Cedric Blancher
Post by Cedric Blancher
Post by Glenn Fowler
nice catch roland -- this may also fix some spurious bootstrap failures
I've
Post by Glenn Fowler
seen with other compilers
since Mamfiles are generated by nmake the permanent place for the fix is
in
Post by Glenn Fowler
src/cmd/nmake/Makerules.mk
diff attached
OT: Can nmake be used as POSIX make?
Ced
--
Cedric Blancher <cedric.blancher at gmail.com>
Institute Pasteur
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.research.att.com/pipermail/ast-developers/attachments/20131019/4128db9d/attachment.html>
Cedric Blancher
2013-10-19 13:30:00 UTC
Permalink
nice catch roland -- this may also fix some spurious bootstrap failures I've
seen with other compilers
since Mamfiles are generated by nmake the permanent place for the fix is in
src/cmd/nmake/Makerules.mk
diff attached
once you rebuild nmake you can test it by generating new tarballs
package only write base source version=YYYY-MM-DD INIT ast-ksh
the tarballs will be in $PACKAGEROOT/lib/package/tgz
Glenn, could you send the full regenerated Mamfiles for
ast-ksh.20131010 and ast-open.20131010, please? Preferably with printf
"%s" args instead of echo '' args for Android compatibility.

Ced
--
Cedric Blancher <cedric.blancher at gmail.com>
Institute Pasteur
Loading...