Hi,
the following gcc compile/link (in bldrtn) works fine on our Linux
Servers
# Set the runtime path since routines run as setuid.
EXTRA_LFLAG="-Wl,-rpath,$DB2PATH/lib"
# If an embedded SQL program, precompile and bind it.
if [ -f $1".sqc" ]
then
./embprep $1 $2
fi
# Compile the program.
gcc $EXTRA_C_FLAGS -fpic -I$DB2PATH/include -c $1.c -D_REENTRANT
# Link the program and create a shared library
gcc $EXTRA_C_FLAGS -shared -o $1 $1.o $EXTRA_LFLAG -L$DB2PATH/lib -ldb2
-lpthread
However, when I try to use the same on our AIX Server (64bit on 5.3), I
get strange gcc errors on the Link
ld: 0706-012 The -p flag is not recognized.
ld: 0706-012 The -a flag is not recognized.
ld: 0706-012 The -t flag is not recognized.
ld: 0706-012 The -h flag is not recognized.
collect2: ld returned 255 exit status
cp: application_id: No such file or directory
If I leave off the $EXTRA_LFLAG, it compiles/Links fine, but gives
runtime errors so I guess it is needed ...
Anyone else have working gcc commands to use in bldrtn on AIX?
- the default bldrtn on AIX has commands for xlc_r and not gcc
Many thanks.
PaulR.