Subject: bug#20940: [bug-diffutils] bug#20940: Issue with AIX build ld:Undefined symbol: @4@null_action

From: Pete Lancashire <[email-masked]>
Date: Mon, 6 Jul 2015 11:10:45 -0700

Moved to 3.3, same failure

same loader

$ `which ld` -V
/usr/bin/ld: LD 7.1.3(4/1/14)

  (cmp, diff, diff3 are ok)

  CC       sdiff.o
  CCLD     sdiff
ld: 0711-317 ERROR: Undefined symbol: @4@null_action
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
1586-347 (U) An error occurred during linking of the object produced by the
IPA Link step.  The link return code was 8.

Sadly either -bnoquiet and -bnoquiet cause ./configure to crash, so in src
I appended to the Makefile LDFLAGS -bnoquiet

Removing all the options and then sequentially adding them back the
offender was the setting of the optimizer to level 5 (-O5).

Setting it to level 4 (-O4) gave no errors

Just a side note even with no options make check fails at

     CC       test-fcntl-h.o
      "test-fcntl-h.c", line 76.10: 1506-052 (S) Duplicate case label for
value 0. Labels must be unique.
      "test-fcntl-h.c", line 118.10: 1506-052 (S) Duplicate case label for
value 0. Labels must be unique.

       Other GNU packages also fail make check here as well

The error shows up with the optimizer is set to level 5 -O5. The difference
between this level and level 4 -O4 is
with level 5 the option qipa is change from the default of object
(-qipa=object) to level=2 (-qipa=level=2).

-O5 is the same as  ... -O4 -qipa=level=2 ...

As another side note, I've build about 6-7 other GNU packages with -O5 and
no issues, or at least no issues with O5.

Update ...

hacking in -bnoquiet to the src/Makefile for LDFLAGS

  CCLD     sdiff
(ld): setopt 64
(ld): halt 4
(ld): setopt rtl
(ld): setopt rtllib
(ld): setopt symbolic:1
(ld): setfflag 4
(ld): savename sdiff
(ld): filelist 10 1
(ld): i /tmp/.o_ipagmyMae
(ld): i /tmp/.o_ipawyyMaj
(ld): setopt noautoimp
(ld): i /lib/crt0_64.o
(ld): setopt autoimp
(ld): i /usr/local/lib/libiconv.a
(ld): lib /usr/vac/lib/libxlopt.a
(ld): lib /usr/vac/lib/libxlipa.a
(ld): lib /usr/vac/lib/libxl.a
(ld): lib /usr/lib/libpthreads.a
(ld): lib /usr/lib/libc.a
(ld): lib /usr/lib/librtl.a
LIBRARY: Shared object /usr/local/lib/libiconv.a[shr4_64.o]: 10 symbols
imported.
LIBRARY: Shared object libpthreads.a[shr_xpg5_64.o]: 346 symbols imported.
LIBRARY: Shared object libc.a[shr_64.o]: 3095 symbols imported.
LIBRARY: Shared object libc.a[posix_aio_64.o]: 20 symbols imported.
LIBRARY: Shared object libc.a[aio_64.o]: 18 symbols imported.
LIBRARY: Shared object libc.a[pse_64.o]: 8 symbols imported.
LIBRARY: Shared object libc.a[dl_64.o]: 4 symbols imported.
LIBRARY: Shared object libc.a[pty_64.o]: 1 symbols imported.
LIBRARY: Shared object libc.a[cthread_64.o]: 25 symbols imported.
LIBRARY: Shared object libc.a[uchar_64.o]: 4 symbols imported.
LIBRARY: Shared object librtl.a[lazy42_64.o]: 3 symbols imported.
FILELIST: Number of previously inserted files processed: 10
(ld): resolve
RESOLVE: 221 of 7636 symbols were kept.
(ld): addgl /usr/lib/glink64.o
ADDGL: Glink code added for 7 symbols.
(ld): er full
ld: 0711-318 ERROR: Undefined symbols were found.
        The following symbols are in error:
 Symbol                    Inpndx  TY CL Source-File(Object-File) OR
Import-File{Shared-object}
                              RLD: Address  Section  Rld-type Referencing
Symbol
 ----------------------------------------------------------------------------------------------
 @4@null_action            [200]   ER DS sdiff.c(/tmp/.o_ipawyyMaj)
                                   00004d60 .data    R_POS    [202]
<@4@null_action>
ER: The return code is 8.
1586-347 (U) An error occurred during linking of the object produced by the
IPA Link step.  The link return code was 8.

Sadly I will have to stop for a while or until I can spend more time after
work

On Tue, Jun 30, 2015 at 8:02 AM, Pete Lancashire <[email-masked]>
wrote:

> diffutils 3.2
>
> oslevel -s  7100-03-05-1524
>
> xlc is 12.1.0.3
>
> CFLAGS cut back to not attempt optimization
>
> compiler run as xlc_r
>
> "Invokes the compiler for C source files. This command supports all of
> the ISO C99 standard features, and most IBM language extensions. This
> invocation is recommended for all applications."
>
> reference:
> http://www-01.ibm.com/support/knowledgecenter/SSGH2K_12.1.0/com.ibm.xlc121.aix.doc/compiler_ref/tucmpinv.html?lang=en
>
>
> PATH
>  /usr/local/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/home/buildsw/bin:/usr/bin/X11:/sbin:.:/usr/vac/bin:/usr/vacpp/bin
>
> OBJECT_MODE   64
>
> CC       xlc_r
> CFLAGS -qmaxmem=-1 -qarch=pwr7 -qtune=pwr7 -qcache=auto -DSYSV -D_AIX
> -D_AIX71 -D_ALL_SOURCE -DFUNCPROTO=15 -O5 -I/usr/local/include
> LDFLAGS  -L/usr/local/lib64 -L/usr/local/lib -bmaxdata:0x80000000 -brtl
> LIBS
> CPPFLAGS
> CXX      xlc++_r
> CXXFLAGS -I/usr/local/include
>
> make
> [chomp]
>   CC       sdiff.o
>   CCLD     sdiff
> ld: 0711-317 ERROR: Undefined symbol: @4@null_action
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
> information.
> 1586-347 (U) An error occurred during linking of the object produced by
> the IPA Link step.  The link return code was 8.
> Makefile:1132: recipe for target 'sdiff' failed
>
> $ which ld
> /usr/bin/ld
> $ /usr/bin/ld -V
> /usr/bin/ld: LD 7.1.3(4/1/14)
>
>
>
>
>
>
>