Opened 12 months ago

Closed 11 months ago

Last modified 11 months ago

#15746 closed defect (fixed)

Compilation errors under AIX 6.1

Reported by: liuqiong7618 Owned by:
Priority: normal Milestone:
Component: build Version:
Keywords: AIX Cc:
Blocked By: Blocking:
Patch: no

Description

I download the wxWidgets-3.0.0-rc2.tar.bz2 on the AIX 6.1
unzip the file as following:
 bzip2 -d wx*.tar.bz2
 tar -xvf wx*.tar

cd ./wxWidgets/
 ./configure --disable-gui --disable-shared --with-zlib=builtin --with-expat=builtin --disable-std_string
 gmake clean
 gmake

The error will occur as below when make the wxWidgets

Maybe the error from the gcc, So if I should modify the configure to fix this issue?

In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.0/include/c++/powerpc-ibm-aix6.1.0.0/bits/c++locale.h:49,
 from /opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.0/include/c++/iosfwd:45,
 from /opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.0/include/c++/ios:43,
 from /opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.0/include/c++/ostream:45,
 from /opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.0/include/c++/iterator:70,
 from ../include/wx/arrstr.h:116,
 from ../include/wx/wx.h:21,
 from ../include/wx/wxprec.h:58:
/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.0/include/c++/cstdio:109: error: '::fgetpos' has not been declared
/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.0/include/c++/cstdio:111: error: '::fopen' has not been declared
/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.0/include/c++/cstdio:116: error: '::freopen' has not been declared
/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.0/include/c++/cstdio:119: error: '::fsetpos' has not been declared
gmake: * ![.pch/wxprec_baselib/wx/wxprec.h.gch] Error 1

Attachments (3)

aix-2.jpg download (249.1 KB) - added by liuqiong7618 12 months ago.
make error.txt download (53.2 KB) - added by liuqiong7618 12 months ago.
the attachement record the build process in detailed
config.zip download (22.1 KB) - added by liuqiong7618 11 months ago.

Download all attachments as: .zip

Change History (17)

Changed 12 months ago by liuqiong7618

comment:1 Changed 12 months ago by liuqiong7618

I have installed gcc ,gcc-c++,libgcc,libstdc++  and libstdc++-devel on the AIX 6.1

comment:2 Changed 12 months ago by vadz

  • Summary changed from the error on the AIX 6.1 during the make process to Compilation error when including <iterator> under AIX 6.1

I can't help you with this one, it seems like something is broken as the error is given for including <iterator> which is just a standard header. You could try work around this by undefining in wxHAS_VECTOR_TEMPLATE_ASSIGN in include/wx/arrstr.h but I'm pretty sure you're going to add other errors later on.

comment:3 Changed 12 months ago by liuqiong7618

The wxWidgets can be built successfully on the other OS(solaris, macos, hpux).

the only differ is the configure process.

I use the configure command for the other system:

./configure --disable-gui --disable-shared --with-zlib=builtin --with-expat=builtin

but the command for the AIX:

./configure --disable-gui --disable-shared --with-zlib=builtin --with-expat=builtin --disable-std_string

the differ is caused by the std_string,please refer to the thread:

http://forums.wxwidgets.org/viewtopic.php?f=19&t=38419

so , is it possible this will infect the make result?

comment:4 Changed 12 months ago by vadz

You have a really broken combination of compiler/standard library. It doesn't support wstring, it can't compile its own <iterator> header. There is really not much we can do here. Try disabling wxHAS_VECTOR_TEMPLATE_ASSIGN as I wrote and hope that you don't run into any other problems... But I'm not overly optimistic.

comment:5 Changed 12 months ago by liuqiong7618

Hi vadz:

Yes ,you are right, I reinstall gcc and gcc++ by the other method, now the gcc seem OK,but there are some error form the wxWidgets .

I configure the wxWidgets by the command, it succeed:

./configure --disable-gui --disable-shared --with-zlib=builtin --with-expat=builtin

then , I make the wxWidgets, the error will occur:

../src/common/wxcrt.cpp: In function 'int vwscanf(const wchar_t*, va_list)':
../src/common/wxcrt.cpp:256:57: error: 'int vwscanf(const wchar_t*, va_list)' was declared 'extern' and later 'static' [-fpermissive]
 static int vwscanf(const wchar_t *format, va_list argptr)
                                                         ^
In file included from ../include/wx/chartype.h:68:0,
                 from ../include/wx/debug.h:19,
                 from ../include/wx/defs.h:688,
                 from ../include/wx/wxprec.h:12:
/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.1/include-fixed/wchar.h:112:12: error: previous declaration of 'int vwscanf(const wchar_t*, __gnuc_va_list)' [-fpermissive]
 extern int vwscanf(const wchar_t * __restrict__, __gnuc_va_list);
            ^
../src/common/wxcrt.cpp: At global scope:
../src/common/wxcrt.cpp:256:12: warning: unused parameter 'format' [-Wunused-parameter]
 static int vwscanf(const wchar_t *format, va_list argptr)
            ^
../src/common/wxcrt.cpp:256:12: warning: unused parameter 'argptr' [-Wunused-parameter]
../src/common/wxcrt.cpp: In function 'int vfwscanf(FILE*, const wchar_t*, va_list)':
../src/common/wxcrt.cpp:263:72: error: 'int vfwscanf(FILE*, const wchar_t*, va_list)' was declared 'extern' and later 'static' [-fpermissive]
 static int vfwscanf(FILE *stream, const wchar_t *format, va_list argptr)
                                                                        ^
In file included from ../include/wx/chartype.h:68:0,
                 from ../include/wx/debug.h:19,
                 from ../include/wx/defs.h:688,
                 from ../include/wx/wxprec.h:12:
/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.1/include-fixed/wchar.h:110:12: error: previous declaration of 'int vfwscanf(FILE*, const wchar_t*, __gnuc_va_list)' [-fpermissive]
 extern int vfwscanf(FILE * __restrict__, const wchar_t * __restrict__, __gnuc_va_list);
            ^
../src/common/wxcrt.cpp: At global scope:
../src/common/wxcrt.cpp:263:12: warning: unused parameter 'stream' [-Wunused-parameter]
 static int vfwscanf(FILE *stream, const wchar_t *format, va_list argptr)
            ^
../src/common/wxcrt.cpp:263:12: warning: unused parameter 'format' [-Wunused-parameter]
../src/common/wxcrt.cpp:263:12: warning: unused parameter 'argptr' [-Wunused-parameter]
../src/common/wxcrt.cpp: In function 'int vfwprintf(FILE*, const wchar_t*, va_list)':
../src/common/wxcrt.cpp:272:73: error: 'int vfwprintf(FILE*, const wchar_t*, va_list)' was declared 'extern' and later 'static' [-fpermissive]
 static int vfwprintf(FILE *stream, const wchar_t *format, va_list argptr)
                                                                         ^
In file included from ../include/wx/chartype.h:68:0,
                 from ../include/wx/debug.h:19,
                 from ../include/wx/defs.h:688,
                 from ../include/wx/wxprec.h:12:
/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.1/include-fixed/wchar.h:322:12: error: previous declaration of 'int vfwprintf(FILE*, const wchar_t*, __gnuc_va_list)' [-fpermissive]
 extern int vfwprintf(FILE * __restrict__, const wchar_t * __restrict__, __gnuc_va_list);
            ^
../src/common/wxcrt.cpp: In function 'int vwprintf(const wchar_t*, va_list)':
../src/common/wxcrt.cpp:287:58: error: 'int vwprintf(const wchar_t*, va_list)' was declared 'extern' and later 'static' [-fpermissive]
 static int vwprintf(const wchar_t *format, va_list argptr)
                                                          ^
In file included from ../include/wx/chartype.h:68:0,
                 from ../include/wx/debug.h:19,
                 from ../include/wx/defs.h:688,
                 from ../include/wx/wxprec.h:12:
/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.1/include-fixed/wchar.h:323:12: error: previous declaration of 'int vwprintf(const wchar_t*, __gnuc_va_list)' [-fpermissive]
 extern int vwprintf(const wchar_t * __restrict__, __gnuc_va_list);
            ^
../src/common/wxcrt.cpp: In function 'int vswscanf(const wchar_t*, const wchar_t*, va_list)':
../src/common/wxcrt.cpp:295:77: error: 'int vswscanf(const wchar_t*, const wchar_t*, va_list)' was declared 'extern' and later 'static' [-fpermissive]
 static int vswscanf(const wchar_t *ws, const wchar_t *format, va_list argptr)
                                                                             ^
In file included from ../include/wx/chartype.h:68:0,
                 from ../include/wx/debug.h:19,
                 from ../include/wx/defs.h:688,
                 from ../include/wx/wxprec.h:12:
/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.1/include-fixed/wchar.h:111:12: error: previous declaration of 'int vswscanf(const wchar_t*, const wchar_t*, __gnuc_va_list)' [-fpermissive]
 extern int vswscanf(const wchar_t * __restrict__, const wchar_t * __restrict__, __gnuc_va_list);
            ^
gmake: * [baselib_wxcrt.o] Error 1

Changed 12 months ago by liuqiong7618

the attachement record the build process in detailed

comment:6 Changed 12 months ago by liuqiong7618

Hi: any help?

comment:7 Changed 12 months ago by vadz

  • Keywords AIX added
  • Summary changed from Compilation error when including <iterator> under AIX 6.1 to Compilation errors under AIX 6.1

The errors are due to the fact that vswscanf() and other functions are not detected by configure but they do have their declarations in the system headers. Please check your config.log for what exactly happens when testing for this function (if necessary, rerun configure again).

comment:8 Changed 11 months ago by liuqiong7618

This is my config.log, rerun configure but it fail also.

Changed 11 months ago by liuqiong7618

comment:9 Changed 11 months ago by liuqiong7618

configure:30035: checking for vswscanf
configure:30062: gcc -o conftest  -D_LINUX_SOURCE_COMPAT   conftest.c  -lm >&5
collect2: fatal error: library libm not found
compilation terminated.

so , it seem like it is caused by gcc?

comment:10 Changed 11 months ago by liuqiong7618

I have installed the bos.adt.libm package from the AIX system installation media CD.

Now the library libm can be found, and the wxWidget can be configured and built successfully on the AIX 6.1

Thank you for your help.

comment:11 follow-up: Changed 11 months ago by neis

After looking at libm related tests in configure.in, our logic currently seems the be as follows:

  1. Can cos und floor be resolved without libm? If yes, everything is ok and we are done.
  2. Add libm to the list of libraries and see if we can now resolve sin and ceil? If yes, everything is ok, we are done
  3. If adding libm we are - according to the comment - not sure what to do.

IMHO, this ticket shows that in this last case just going on with libm being added to the list of libraries is not a good idea, as it will cause all the following tests to fail as well, since we always get collect2: fatal error: library libm not found. This will result in obscure problems like the one reported here.

SO, IMHO, we should either stop just there and ask the user to fix the issue of the missing "floating point functions", or if we go on, we should remove "-lm" from the list of libraries again, so if it doesn't help, it at least won't cause additional problems. And hopefully, the worst thing that's going to happen is the linker complaining about missing floating point functions, which should be relatively easy to understand...
So I'd propose something like this (untested):

--- configure.in.orig   2013-12-19 11:33:48.000000000 +0100
+++ configure.in        2013-12-19 11:35:22.000000000 +0100
@@ -2316,6 +2316,7 @@
     AC_MSG_RESULT(yes)
 else
     AC_MSG_RESULT(no)
+    LIBS_NO_M="$LIBS"
     LIBS="$LIBS -lm"
     # use different functions to avoid configure caching
     have_sin=0
@@ -2328,6 +2329,7 @@
     else
         AC_MSG_RESULT(no)
         # not sure we should warn the user, crash, etc.
+       LIBS="$LIBS_NO_M"
     fi
 fi

comment:12 in reply to: ↑ 11 Changed 11 months ago by neis

Sorry, I failed even at proofreading...

After looking at libm related tests in configure.in, our logic currently seems the be as follows:

... seems to be as follows:

  1. If adding libm we are - according to the comment - not sure what to do.

If adding libm didn't help, we are ...

comment:13 Changed 11 months ago by vadz

  • Resolution set to fixed
  • Status changed from new to closed

Glad to see that this was resolved, so closing it -- and I'll remove -lm to make this problem easier to detect if anybody else runs into it.

comment:14 Changed 11 months ago by VZ

(In [75403]) Don't link with -lm if the check using it failed.

It is useless and can, apparently, result in problems, see #15746.

Note: See TracTickets for help on using tickets.