[MDEV-4941] make: AIX fails with 'Identifier not allowed in cast'; syntax error in include/my_global.h Created: 2013-08-23  Updated: 2014-11-23  Due: 2014-11-19  Resolved: 2014-11-23

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Affects Version/s: 5.5.33a-galera
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Michael Felt Assignee: Unassigned
Resolution: Incomplete Votes: 1
Labels: None
Environment:

AIX 5.3 TL07 (5300-07-01-0748) - old to be more backwards compatible;
IBM XL C/C++ for AIX, V11.1 (5724-X13)
Version: 11.01.0000.0013


Attachments: File aix.storage_myisam.diff     File aix.storage_xtradb.diff     File aix_make_mariadb-5.5.33a.script     File aix_make_with_ignore_mariadb-5.5.33a.script     File alloca.h     File alloca.h     File mariadb_aix.patch     File nohup.out     File nohup.out     File nohup.out.bz2    

 Description   

after successful cmake, make fails at about 5%.
As the block with the error is/was made for AIX, perhaps it was developed for gcc rather than vacpp/vac.

tail of make output:

[  5%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/compat.c.o
[  5%] Building C object cmd-line-utils/readline/CMakeFiles/readline.dir/savestring.c.o
Linking C static library libreadline.a
Target "cmd-line-utils/readline/CMakeFiles/readline.dir/build" is up to date.
[  5%] Built target readline
Scanning dependencies of target mytap
[  5%] Building C object unittest/mytap/CMakeFiles/mytap.dir/tap.c.o
"/data/prj/mariadb/mariadb-5.5.31/include/my_global.h", line 300.74: 1506-272 (E) Identifier not allowed in cast or sizeof declarations.
"/data/prj/mariadb/mariadb-5.5.31/include/my_global.h", line 300.76: 1506-046 (S) Syntax error.
"/data/prj/mariadb/mariadb-5.5.31/unittest/mytap/tap.c", line 352.49: 1506-234 (W) Expecting a new-line character on #ifdef directive.
make: 1254-004 The error code from the last command is 1.
 
 
Stop.
make: 1254-004 The error code from the last command is 2.
 
 
Stop.
make: 1254-004 The error code from the last command is 2.
 
 
Stop.

===
FYI: from include/my_global.h

 +292  /* Go around some bugs in different OS and compilers */
  +293  #ifdef _AIX                     /* By soren@t.dk */
  +294  #define _H_STRINGS
  +295  #define _SYS_STREAM_H
  +296  /* #define _AIX32_CURSES */     /* XXX: this breaks AIX 4.3.3 (others?). */
  +297  #define ulonglong2double(A) my_ulonglong2double(A)
  +298  #define my_off_t2double(A)  my_ulonglong2double(A)
  +299  C_MODE_START
  +300  inline double my_ulonglong2double(unsigned long long A) { return (double A); }
  +301  C_MODE_END
  +302  #endif /* _AIX */
  +303
  +304  #ifdef UNDEF_HAVE_INITGROUPS                    /* For AIX 4.3 */
  +305  #undef HAVE_INITGROUPS
  +306  #endif
  +307
  +308  /* gcc/egcs issues */
  +309
  +310  #if defined(__GNUC) && defined(__EXCEPTIONS)
  +311  #error "Please add -fno-exceptions to CXXFLAGS and reconfigure/recompile"
  +312  #endif

===
No idea how to proceed here - will test suggestions!



 Comments   
Comment by Michael Felt [ 2013-08-26 ]

just thought I would add - the version: I downloaded a tarball with 5.5.31 (and for MDEV-4940 5.5.32) but no galeria in the archive name. That name is in the version string here because that is what the bug-reported offered.

I would like to add that it is quite confusing - considering the number of "unreleased-versions" that show up (and now I cannot find the link, navigation here is "different" from what I used to).

Going to try the 10.0.4 tarball real soon. Would be nice it that built/packaged.

Comment by Michael Felt [ 2013-08-26 ]

Get, basically, the same issue with 10.0.4:
starting with "cmake ."
...
– Performing Test HAVE_PEERCRED
– Performing Test HAVE_PEERCRED - Failed
– Performing Test HAVE_SOCKPEERCRED
– Performing Test HAVE_SOCKPEERCRED - Failed
– Looking for event.h
– Looking for event.h - not found
– Configuring done
– Generating done
– Build files have been written to: /data/prj/mariadb/mariadb-10.0.4
root@x093:[/data/prj/mariadb/mariadb-10.0.4]buildaix
/usr/bin/buildaix: using existing Makefile
/usr/bin/buildaix: run make distclean to get a standard AIX configure

rw-rr- 1 root system 106273 Aug 26 13:11 ./Makefile
rw-rr- 1 1001 1001 19320 Aug 15 14:36 config.h.cmake

+ make > build/aix/make.out
"/data/prj/mariadb/mariadb-10.0.4/cmd-line-utils/readline/history.c", line 409.32: 1506-068 (W) Operation between types "char*" and "char**" is not allowed.
"/data/prj/mariadb/mariadb-10.0.4/cmd-line-utils/readline/history.c", line 410.21: 1506-068 (W) Operation between types "char*" and "char**" is not allowed.
"/data/prj/mariadb/mariadb-10.0.4/cmd-line-utils/readline/history.c", line 420.23: 1506-068 (W) Operation between types "char*" and "char**" is not allowed.
"/data/prj/mariadb/mariadb-10.0.4/cmd-line-utils/readline/history.c", line 424.25: 1506-068 (W) Operation between types "char*" and "char**" is not allowed.
"/data/prj/mariadb/mariadb-10.0.4/cmd-line-utils/readline/history.c", line 430.19: 1506-068 (W) Operation between types "char*" and "char**" is not allowed.
"/data/prj/mariadb/mariadb-10.0.4/include/my_global.h", line 298.74: 1506-272 (E) Identifier not allowed in cast or sizeof declarations.
"/data/prj/mariadb/mariadb-10.0.4/include/my_global.h", line 298.76: 1506-046 (S) Syntax error.
"/data/prj/mariadb/mariadb-10.0.4/unittest/mytap/tap.c", line 352.49: 1506-234 (W) Expecting a new-line character on #ifdef directive.
make: 1254-004 The error code from the last command is 1.

Stop.
make: 1254-004 The error code from the last command is 2.

Stop.
make: 1254-004 The error code from the last command is 2.

Stop.
+ make install DESTDIR=/var/tmp/root/mariadb-10.0.4.0 > build/aix/install.out
"/data/prj/mariadb/mariadb-10.0.4/include/my_global.h", line 298.74: 1506-272 (E) Identifier not allowed in cast or sizeof declarations.
"/data/prj/mariadb/mariadb-10.0.4/include/my_global.h", line 298.76: 1506-046 (S) Syntax error.
"/data/prj/mariadb/mariadb-10.0.4/unittest/mytap/tap.c", line 352.49: 1506-234 (W) Expecting a new-line character on #ifdef directive.
make: 1254-004 The error code from the last command is 1.

Stop.
make: 1254-004 The error code from the last command is 2.

Stop.
make: 1254-004 The error code from the last command is 2.

Stop.
make install returned an error
root@x093:[/data/prj/mariadb/mariadb-10.0.4]
===
There is more "stdout" in build/aix/make.out; however, i thought the stderr to display is enough for now.
Same error (Identifier not allowed) as with 5.5.31

Comment by Sergei Golubchik [ 2013-08-30 ]

try this:

-inline double my_ulonglong2double(unsigned long long A)

{ return (double A); }

+inline double my_ulonglong2double(unsigned long long A)

{ return (double) A; }

if it'll help, we'll use this fix in the next release

Comment by Michael Felt [ 2013-08-31 ]

The initial report is: this moves things along...
[ 8%] Building C object strings/CMakeFiles/strings.dir/int2str.c.o
[ 8%] Building C object strings/CMakeFiles/strings.dir/is_prefix.c.o

aka - error message is gone.

However, we 'pause' again at:
[ 22%] Building C object mysys/CMakeFiles/mysys.dir/ma_dyncol.c.o
"/data/prj/mariadb/mariadb-5.5.31/mysys/ma_dyncol.c", line 1381.5: 1506-343 (S) Redeclaration of dynamic_column_get differs from previous declaration on line 128 of "/data/prj/mariadb/mariadb-5.5.31/include/ma_dyncol.h".
"/data/prj/mariadb/mariadb-5.5.31/mysys/ma_dyncol.c", line 1381.5: 1506-050 (I) Return type "int" in redeclaration is not compatible with the previous return type "enum enum_dyncol_func_result".
"/data/prj/mariadb/mariadb-5.5.31/mysys/ma_dyncol.c", line 1453.5: 1506-343 (S) Redeclaration of dynamic_column_delete differs from previous declaration on line 115 of "/data/prj/mariadb/mariadb-5.5.31/include/ma_dyncol.h".
"/data/prj/mariadb/mariadb-5.5.31/mysys/ma_dyncol.c", line 1453.5: 1506-050 (I) Return type "int" in redeclaration is not compatible with the previous return type "enum enum_dyncol_func_result".
"/data/prj/mariadb/mariadb-5.5.31/mysys/ma_dyncol.c", line 2105.5: 1506-343 (S) Redeclaration of dynamic_column_update differs from previous declaration on line 106 of "/data/prj/mariadb/mariadb-5.5.31/include/ma_dyncol.h".
"/data/prj/mariadb/mariadb-5.5.31/mysys/ma_dyncol.c", line 2105.5: 1506-050 (I) Return type "int" in redeclaration is not compatible with the previous return type "enum enum_dyncol_func_result".

Comment by Michael Felt [ 2013-09-01 ]

make -i output, from when it last failed.

Comment by Michael Felt [ 2013-09-01 ]

make -i output, last attempts failed for it to show up.

I still do not see the attachment. Hope someone else can.

Shall I cut/paste? 500k text roughly.

Comment by Sergei Golubchik [ 2013-09-09 ]

I've fixed some of the problems — they were mostly C++ (//) comments in C files.

But I haven't fixed all of them, in particular I haven't fixed XtraDB (we don't maintain it, Percona does), I haven't implemented thread pool for AIX (currently, the compilation fails with #error threadpool is not available on this platform), and I haven't fixed async client library.

AIX is not our officially supported platform and we don't have AIX installed on our build machines. If you'd still like to compile MariaDB on AIX you can try the following: 1) report a bug to Percona about C++ comments in C files, 2) either fix thread pool and async client library or disable them on AIX (which is, probably, much easier to do). I will be happy to apply your patch that fixes compilation problems on AIX, even though we don't support AIX officially.

Comment by Michael Felt [ 2013-09-25 ]

Compiling version *.33.

First set of warnings:

Linking C executable no_plan-t
ld: 0711-224 WARNING: Duplicate symbol: __fe_def_env
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
Target "unittest/examples/CMakeFiles/no_plan-t.dir/build" is up to date.
[ 10%] Built target no_plan-t
[ 10%] Building C object unittest/examples/CMakeFiles/simple-t.dir/simple-t.c.o
Linking C executable simple-t
ld: 0711-224 WARNING: Duplicate symbol: __fe_def_env
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
Target "unittest/examples/CMakeFiles/simple-t.dir/build" is up to date.
[ 10%] Built target simple-t
[ 10%] Building C object unittest/examples/CMakeFiles/skip-t.dir/skip-t.c.o
Linking C executable skip-t
ld: 0711-224 WARNING: Duplicate symbol: __fe_def_env
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
Target "unittest/examples/CMakeFiles/skip-t.dir/build" is up to date.
[ 10%] Built target skip-t
[ 10%] Building C object unittest/examples/CMakeFiles/skip_all-t.dir/skip_all-t.c.o
Linking C executable skip_all-t
ld: 0711-224 WARNING: Duplicate symbol: __fe_def_env
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
Target "unittest/examples/CMakeFiles/skip_all-t.dir/build" is up to date.
[ 10%] Built target skip_all-t
[ 10%] Building C object unittest/examples/CMakeFiles/todo-t.dir/todo-t.c.o
Linking C executable todo-t
ld: 0711-224 WARNING: Duplicate symbol: __fe_def_env
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
Target "unittest/examples/CMakeFiles/todo-t.dir/build" is up to date.

Other extremely noticeable issue:
"/usr/include/alloca.h", line 34.9: 1540-1401 (I) An unknown "pragma __alloca" is specified.
"/data/prj/mariadb/mariadb-5.5.33/sql/gcalc_slicescan.h", line 183.7: 1540-1608 (W) An anonymous union should only define non-static data members.
"/data/prj/mariadb/mariadb-5.5.33/sql/gcalc_slicescan.h", line 193.7: 1540-1608 (W) An anonymous union should only define non-static data members.
"/data/prj/mariadb/mariadb-5.5.33/sql/gcalc_slicescan.h", line 204.7: 1540-1608 (W) An anonymous union should only define non-static data members.

I notice the first message is coming from an AIX file (/usr/include/alloca.h) so I am wondering if this is being caused, in part at least, by mariadb include files being processed earlier.

re: xtradb and c++ comments.

I am trying to get the CMAKE command to insert different values for CMAKE and CPPFlags.

I have tried
export CFLAGS=${CFLAGS:="-O2 -qlanglvl=extc99"}
export CPPFLAGS=${CPPFLAGS:=-I/opt/include}

  1. cmake -DWITH_JEMALLOC=no .

The cmake command completes, the regular make after that does not.

So, how can I automate the setting of these flags?

Comment by Sergei Golubchik [ 2013-09-25 ]

I'd say, you're doing everything correctly. Setting CFLAGS and CPPFLAGS before cmake — that's how it works.

Try make VERBOSE=1 it'll show you the exact command line that compiler is seeing.

Alternatively, you might try setting CMAKE_C_FLAGS instead of CFLAGS and CPPFLAGS. But it shouldn't make a difference (unless we have a bug in our cmake files).

Comment by Vladislav Vaintroub [ 2013-09-25 ]

I would suggest to build from scratch , or remove CMakeCache.txt in the build directory.
IF you just changed env. variables and rerun cmake after an already existing build with other compile options, this would not have the desired effect.

Comment by Michael Felt [ 2013-09-26 ]

Took your "clean start" advice:
1148 rm -rf maria*33
1149 gunzip -dc mariadb-5.5.33.tar.gz | tar xf -

1155 cd *33
1156 export CFLAGS=${CFLAGS:="-O2 -qlanglvl=extc99"}
1157 export CPPFLAGS=${CPPFLAGS:=-I/opt/include}
1158 cmake -DWITH_JEMALLOC=no .
1159 export VERBOSE=1

and now starting make, will upload the nohup.out when it finishes.

Comment by Michael Felt [ 2013-09-26 ]

/usr/include/alloca.h - No idea why this is coming up as a a message:

"/usr/include/alloca.h", line 34.9: 1540-1401 (I) An unknown "pragma __alloca" is specified.

Further, the compressed nohup.out contents

Comment by Michael Felt [ 2013-09-26 ]

p.s. I will try and check back here about once a day to see if there are suggestions like above for how to move forward, new tests, etc.. Maybe that is enough to change status from "Stalled" (that is what I would expect for a bug reported, and the reporter is not doing anything).

Comment by Frank Fegert [ 2013-10-22 ]

Hello Michael,

glad to see someone else besides me (https://lists.launchpad.net/maria-developers/msg05749.html) is too trying to get MariaDB/MySQL to (again) work with AIX! So far, with the attached patch and "-DWITH_JEMALLOC=no" i'm unfortunately only getting as far as you are getting

For me the first error from "ld" - which i see from your nohup.out, you're also getting - trying to link a binary from the unit tests against the static libraries, stops the entire build process:

...
gmake[2]: Leaving directory `/home/u09422fra/rpmbuild/tmp/mariadb-5.5.33a/build-mysql'
gmake -f unittest/mysys/CMakeFiles/explain_filename-t.dir/build.make unittest/mysys/CMakeFiles/explain_filename-t.dir/build
gmake[2]: Entering directory `/home/u09422fra/rpmbuild/tmp/mariadb-5.5.33a/build-mysql'
/opt/freeware/bin/cmake -E cmake_progress_report /home/u09422fra/rpmbuild/tmp/mariadb-5.5.33a/build-mysql/CMakeFiles
[ 46%] Building CXX object unittest/mysys/CMakeFiles/explain_filename-t.dir/explain_filename-t.cc.o
cd /home/u09422fra/rpmbuild/tmp/mariadb-5.5.33a/build-mysql/unittest/mysys && /usr/vacpp/bin/xlC_r -+ -DHAVE_CONFIG_H -ma -O2 -qlanglvl=extc99 -qstrict -qoptimize=2 -qmaxmem=65536 -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 -D_ALL_SOURCE -DFUNCPROTO=15 -I/opt/freeware/include -qthreaded -qhalt=e -qstaticinline -g -DDBUG_OFF -I/home/u09422fra/rpmbuild/tmp/mariadb-5.5.33a/build-mysql/include -I/home/u09422fra/rpmbuild/tmp/mariadb-5.5.33a/sql -I/home/u09422fra/rpmbuild/tmp/mariadb-5.5.33a/regex -I/home/u09422fra/rpmbuild/tmp/mariadb-5.5.33a/extra/yassl/include -I/home/u09422fra/rpmbuild/tmp/mariadb-5.5.33a/include -I/home/u09422fra/rpmbuild/tmp/mariadb-5.5.33a/unittest/mytap -o CMakeFiles/explain_filename-t.dir/explain_filename-t.cc.o -c /home/u09422fra/rpmbuild/tmp/mariadb-5.5.33a/unittest/mysys/explain_filename-t.cc
"/usr/include/alloca.h", line 34.9: 1540-1401 (I) An unknown "pragma __alloca" is specified.
Linking CXX executable explain_filename-t
cd /home/u09422fra/rpmbuild/tmp/mariadb-5.5.33a/build-mysql/unittest/mysys && /opt/freeware/bin/cmake -E cmake_link_script CMakeFiles/explain_filename-t.dir/link.txt --verbose=1
/usr/vacpp/bin/xlC_r -ma -O2 -qlanglvl=extc99 -qstrict -qoptimize=2 -qmaxmem=65536 -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 -D_ALL_SOURCE -DFUNCPROTO=15 -I/opt/freeware/include -qthreaded -qhalt=e -qstaticinline -g -DDBUG_OFF -L/opt/freeware/lib/mariadb -L/opt/freeware/lib -Wl,-bmaxdata:0x80000000 CMakeFiles/explain_filename-t.dir/explain_filename-t.cc.o -o explain_filename-t -Wl,-brtl,-bnoipath,-bexpfull ../../sql/libsql.a ../mytap/libmytap.a ../../storage/archive/libarchive.a ../../storage/blackhole/libblackhole.a ../../storage/csv/libcsv.a ../../storage/federatedx/libfederatedx.a ../../storage/heap/libheap.a ../../storage/maria/libaria.a ../../storage/myisam/libmyisam.a ../../storage/myisammrg/libmyisammrg.a ../../storage/perfschema/libperfschema.a ../../storage/xtradb/libxtradb.a ../../plugin/feedback/libfeedback.a /usr/lib/libssl.a /usr/lib/libcrypto.a ../../sql/libpartition.a ../../mysys/libmysys.a ../../dbug/libdbug.a ../../mysys/libmysys.a ../../dbug/libdbug.a -lz -lm ../../strings/libstrings.a ../../vio/libvio.a ../../regex/libregex.a -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib
ld: 0711-317 ERROR: Undefined symbol: .unpack_row(const Relay_log_info*,TABLE*,const unsigned int,const unsigned char* const,const unsigned char*,const st_bitmap*,const unsigned char** const,unsigned long* const)
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
gmake[2]: *** [unittest/mysys/explain_filename-t] Error 8
gmake[2]: Leaving directory `/home/u09422fra/rpmbuild/tmp/mariadb-5.5.33a/build-mysql'
gmake[1]: *** [unittest/mysys/CMakeFiles/explain_filename-t.dir/all] Error 2
gmake[1]: Leaving directory `/home/u09422fra/rpmbuild/tmp/mariadb-5.5.33a/build-mysql'
gmake: *** [all] Error 2

I think in your case the missing "-qhalt=e" lets you get further, but with not much better end results. Anyway, even if i disable the unit tests, i think the error will pop up for every instance of linking against the static libraries.

I checked the object files, they seem to have the missing symbols. Somewhere along the lines of creating the static libraries, things get screwed up, since "nm" shows e.g. the above mentioned ".unpack_row" as undefined in libsql.a. I suspect this is another case of the odd way linking and loading works in AIX (see: http://download.boulder.ibm.com/ibmdl/pub/software/dw/aix/es-aix_ll.pdf).

Unfortunately i'm not familiar with CMake at all, so i'm having trouble figuring out if this issue can be fixed somewhere in the build infrastructure of CMake. Is anyone here more versed in CMake and could help resolve the linking issue?

Thanks & best regards,

Frank Fegert

Comment by Michael Felt [ 2013-10-24 ]

Hi Frank. Also good to know I am not the only one looking at this.

I am also hoping to have it finish - not as an rpm, but as an installp package. (Personal preference).
Time to go back to fresh downloads, and try again.

Comment by Michael Felt [ 2013-10-25 ]

diff -u outputs to convert C++, c99 style comments, i.e. //
to c89 comments /* .... */

Comment by Michael Felt [ 2013-10-25 ]

Downloaded mariadb-5.5.33a.tar.gz
unpacked
cmake . -DWITH_JEMALLOC=no

applied Franks "mariadb_aix.patch"
made lots of // comment corrections in storage - see two diff files attached.

And come up, again, with ld errors.

ld: 0711-224 WARNING: Duplicate symbol: mutex_list
ld: 0711-224 WARNING: Duplicate symbol: concurrency
ld: 0711-224 WARNING: Duplicate symbol: __fe_def_env
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
ld: 0711-317 ERROR: Undefined symbol: .unpack_row(const Relay_log_info*,TABLE*,const unsigned int,const unsigned char* const,const unsigned char*,const st_bitmap*,const unsigned char** const,unsigned long* const)
make[2]: *** [unittest/mysys/explain_filename-t] Error 8
make[1]: *** [unittest/mysys/CMakeFiles/explain_filename-t.dir/all] Error 2
make: *** [all] Error 2

Also, lots of warning messages from the IBM compiler that are repeated many many times, will upload a scripted session with the messages - soon.

Michael

Comment by Michael Felt [ 2013-10-25 ]

script files: first one is as far as make gets without stopping: second one - continue from there with ignore flag (i.e., make -i)
also attached: AIX 5.3 /usr/include/alloca.h file as there is a frequent warning for line 34 re: an undefined pragma - consider this FYI

Hope this helps.

a lot of "failures" will be resolved one the duplicate symbol issue for:
ld: 0711-224 WARNING: Duplicate symbol: __fe_def_env
is addressed.

regards,
Michael F

Comment by Elena Stepanova [ 2014-10-19 ]

I see the last comment came with a bunch of attachments, which we probably didn't realize back then.
Is this issue still relevant at all?
If it is, are these diffs and other attachments make a complete patch which solves all compilation problems on AIX?
If they are, can anyone of the participants put them together in a single patch which applies to recent MariaDB tree, so Sergei could apply it?

Comment by Elena Stepanova [ 2014-11-23 ]

Closing as Incomplete for now, please comment to re-open if necessary.

Generated at Thu Feb 08 07:00:25 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.