g++ 4.8 fails with -Ox option

Patrick Begou Patrick.Begou@legi.grenoble-inp.fr
Mon Jul 22 23:59:00 GMT 2013


Ian Lance Taylor wrote:
> On Fri, Jul 19, 2013 at 5:27 AM, Patrick Begou
> <Patrick.Begou@legi.grenoble-inp.fr> wrote:
>> I get a strange problem with g++ 4.8. My server has gcc44-c++-4.4.1
>> installed.
>> I've installed gcc4.8 in my home from gcc-4.8-20130711.tar.gz
>> gcc-4.8-infrastructure.tar.gz.
>> PATH, LD_LIBRARY_PATH are setup to reach first this 4.8 install.
>>
>> Initially I get the error runing the configure script to build OpenMPI, so I
>> extract the small peace of test code in "prog.C" file for testing and:
>>
>> g++ -o conftest -DNDEBUG -finline-functions prog.C
>> Is working but:
>> g++ -o conftest -O3 -DNDEBUG -finline-functions prog.C
>> says:
>>
>> In file included from /usr/include/stdio.h:909:0,
>> from prog.C:141:
>> /usr/include/bits/stdio.h: In function ‘__ssize_t getline(char**, size_t*,
>> FILE*)’:
>> /usr/include/bits/stdio.h:118:52: error: ‘__getdelim’ was not declared in
>> this scope
>> return __getdelim (__lineptr, __n, '\n', __stream);
>>
>> Same behavior with -O2 or -O1.
>> g++ 4.8 works with -O0.
>>
>> I've no idea about this problem. Thanks for your advices.
> Using optimization changes how your library header files behave.  Look
> for #ifdef __OPTIMIZE__ or defined(__OPTIMIZE__).  This looks like a
> problem with your C library, not with GCC proper.
>
> Ian
>
In http://gfortran.com/download/x86_64/PLEASE_README.txt the requirement for 
glibc is :
"... The provided compilers need glibc 2.4 or newer, however the library libgomp 
needs glibc 2.6...."

I am runing glibc-devel-2.11.3-12.59.1.x86_64
so my glibc level seams correct no ?

Patrick

-- 
===================================================================
|  Equipe M.O.S.T.         |                                      |
|  Patrick BEGOU           | mailto:Patrick.Begou@grenoble-inp.fr |
|  LEGI                    |                                      |
|  BP 53 X                 | Tel 04 76 82 51 35                   |
|  38041 GRENOBLE CEDEX    | Fax 04 76 82 52 71                   |
===================================================================




More information about the Gcc-help mailing list