Issue with Latest GDB on AIX with GCC-6.12

David Edelsohn
Sun Feb 12 21:05:00 GMT 2017

On Fri, Feb 10, 2017 at 10:52 AM, David Edelsohn <> wrote:
> On Fri, Feb 10, 2017 at 2:22 AM, Nitish Kumar Mishra
> <> wrote:
>> Hi All,
>>> 3. GDB with GCC-6.1, 64 bit mode, with static options : NOT WORKING
>>> 4. GDB with GCC-6.1, 64 bit mode, without static options : COMPILATION ERROR.
>>> P.S.: Static options means: -static-libstdc++ -static-libgcc
>>>What is the compilation error?
>> With GCC-6.1, 64 bit mode, WITHOUT static option, below is the output of the
>> compilation error:
>> ld: 0711-317 ERROR: Undefined symbol: ._Unwind_Resume
>> ld: 0711-317 ERROR: Undefined symbol: .__cxa_atexit
>> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
>> collect2: error: ld returned 8 exit status
>>> Does GCC 4.8.5 and GCC 6.1 fail in the same manner?  Neither catch the
>> exception?
>> Yes, by NOT WORKING, I meant, niether catching the exception and process is
>> getting terminated.
> Who built GCC 6.1 for you?  Is this an IBM build or Bull Freeware?
> The version of GCC that you are using was built incorrectly.  There
> have been problems in the past with some of the pre-built binaries
> containing libraries with recently added symbols not correctly
> exported.
> There seems to be a problem with exception handling and -static-libgcc
> in recent versions of GCC on AIX.  I don't know what you have been
> testing and why you were not able to triage this.

Investigating the exception handling problem with another non-IBM AIX
developer, the problem appears to be that statically linking libgcc
and libstdc++ create two, separate and distinct copies of the unwind
tables.  These tables are not merged and the unwinder cannot find the
EH catcher.  It's not immediately clear why this worked in GCC 4.8 and
not in GCC 4.9 and later.

GDB with exception handling should work if libgcc and libstdc++ are
linked as shared libraries.  The linking error with GCC 6.1 is cockpit

Can we disable -static-libgcc and -static-libstdc++ for AIX?

Thanks, David

More information about the Gdb mailing list