[tlbuild] -funsigned-char is not portable

Vladimir Volovich vvv at vsu.ru
Wed Jun 3 16:31:08 CEST 2009


"PB" == Peter Breitenlohner writes:

 PB> As I just started to write to Vladimir, this flag was present in
 PB> the TL2008 version of Makefile.in for bibtex8.  When I translated
 PB> that into Makefile.am for TL2009 I first overlooked/forgot this
 PB> flag and only recently reintroduced it.

apparentlty the commands which compile the bibtex8 C files also use this
flag but they work:

        xlc -DPACKAGE_NAME=\"bibtex8\ for\ TeX\ Live\" -DPACKAGE_TARNAME=\"bibtex8-for-tex-live\" -DPACKAGE_VERSION=\"3.71\" -DPACKAGE_STRING=\"bibtex8\ for\ TeX\ Live\ 3.71\" -DPACKAGE_BUGREPORT=\"tex-k at tug.org\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_FSEEKO=1 -DHAVE_DIRENT_H=1 -DSTDC_HEADERS=1 -DHAVE_ASSERT_H=1 -DHAVE_FLOAT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_MEMORY_H=1 -DHAVE_PWD_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_UNISTD_H=1 -DHAVE_PUTENV=1 -DHAVE_STRCASECMP=1 -DHAVE_STRTOL=1 -DHAVE_STRSTR=1 -DHAVE_BCMP=1 -DHAVE_BCOPY=1 -DHAVE_BZERO=1 -DHAVE_GETCWD=1 -DHAVE_GETWD=1 -DHAVE_INDEX=1 -DHAVE_MEMCMP=1 -DHAVE_MEMCPY=1 -DHAVE_RINDEX=1 -DHAVE_STRCHR=1 -DHAVE_STRRCHR=1 -Dinline=__inline -DHAVE_PROTOTYPES=1 -I. -I../../../texk/bibtex8 -I/usr/local/vvv/src/source/Work/texk -I/usr/local/vvv/src/source/texk -DUNIX -DKPATHSEA -DSUPPORT_8BIT -I/opt/freeware/include -DUSE_STDLIB_WORKAROUNDS -funsigned-char -O2 -qmaxmem=262144 -qarch=com -qlanglvl=extended -qcpluscmt -c ../../../texk/bibtex8/utils.c

but the linking fails:

xlc -funsigned-char -O2 -qmaxmem=262144 -qarch=com -qlanglvl=extended -qcpluscmt -o bibtex8 bibtex-1.o bibtex-2.o bibtex-3.o bibtex-4.o bibtex.o utils.o  /usr/local/vvv/src/source/Work/texk/kpathsea/.libs/libkpathsea.a

notice that it is used as a first argument now.

in TL2008, the link command was

xlc -o bibtex8 bibtex-1.o bibtex-2.o bibtex-3.o bibtex-4.o bibtex.o utils.o  ../kpathsea/.libs/libkpathsea.a

and indeed, there is no need to use this flag when linking.

 PB> In other words, this flag was used in the TL2008 build and I
 PB> dislike to just drop it without further analysis.

 PB> So how to proceed?

if it is easy to avoid using this flag in the link command, it's the
simplest approach;

second one is to use an autoconf test such as
http://www.nongnu.org/autoconf-archive/ac_prog_cc_char_subscripts.html
which will allow to use -funsigned-char only on GCC (and the appropriate
other flag on other compilers)

third option (the most time consuming) is to modify bibtex8 sources to
use unsigned char explicitly, instead of char.

Best,
v.


More information about the tlbuild mailing list