http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55317



             Bug #: 55317

           Summary: [i386-regression] just don't strip stdcall suffix in

                    gcc

    Classification: Unclassified

           Product: gcc

           Version: 4.8.0

            Status: UNCONFIRMED

          Severity: blocker

          Priority: P3

         Component: target

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: jojel...@gmail.com





Created attachment 28679

  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28679

testcase



It resulted in link error while building libgcc.



$ /tmp/gcc/host-i686-pc-cygwin/gcc/xgcc -B/tmp/gcc/host-i686-pc-cygwin/gcc/

-B/usr/i686-pc-cygwin/bin/ -B/usr/i686-pc-cygwin/lib/ -isystem

/usr/i686-pc-cygwin/include -isystem /usr/i686-pc-cygwin/sys-include -v

Reading specs from /tmp/gcc/host-i686-pc-cygwin/gcc/specs

COLLECT_GCC=/tmp/gcc/host-i686-pc-cygwin/gcc/xgcc

COLLECT_LTO_WRAPPER=/tmp/gcc/host-i686-pc-cygwin/gcc/lto-wrapper.exe

Target: i686-pc-cygwin

Configured with: ./configure --config-cache --enable-plugin --prefix=/usr

--disable-win32-registry --enable-threads=win32

--enable-languages=c,c++,lto,fortran --with-win32-nlsapi=unicode --enable-tls

--disable-bootstrap --enable-shared --disable-sjlj-exceptions --enable-gomp

--enable-cloog-backend=isl LTLDFLAGS=-no-undefined

lt_cv_deplibs_check_method=pass_all : (reconfigured) ./configure --config-cache

--enable-plugin --prefix=/usr --disable-win32-registry --enable-threads=win32

--enable-languages=c,c++,lto,fortran --with-win32-nlsapi=unicode --enable-tls

--disable-bootstrap --enable-shared --disable-sjlj-exceptions --enable-gomp

--enable-cloog-backend=isl LTLDFLAGS=-no-undefined

lt_cv_deplibs_check_method=pass_all : (reconfigured) ./configure --config-cache

--prefix=/usr --disable-win32-registry --enable-threads=win32

--enable-languages=c,c++,lto,fortran --with-win32-nlsapi=unicode --enable-tls

--disable-bootstrap --enable-shared --disable-sjlj-exceptions --enable-gomp

--enable-cloog-backend=isl LTLDFLAGS=-no-undefined

lt_cv_deplibs_check_method=pass_all

Thread model: win32

gcc version 4.8.0 20121113 (experimental) (GCC)



Use --enable-stdcall-fixup to disable these warnings

Use --disable-stdcall-fixup to disable these fixups

/tmp/gcc/host-i686-pc-cygwin/gcc/crtbegin.o:cygming-crtbegin.c:(.text+0x2f):

undefined reference to `__imp__GetProcAddress'

/tmp/gcc/host-i686-pc-cygwin/gcc/crtbegin.o:cygming-crtbegin.c:(.text+0x78):

undefined reference to `__imp__GetProcAddress'

/tmp/gcc/host-i686-pc-cygwin/gcc/crtbegin.o:cygming-crtbegin.c:(.text+0xcc):

undefined reference to `__imp__GetProcAddress'

/usr/i686-pc-cygwin/bin/ld: /tmp/gcc/host-i686-pc-cygwin/gcc/crtbegin.o: bad

reloc address 0x20 in section `.eh_frame'

collect2: error: ld returned 1 exit status

Makefile:921: recipe for target `libgcc_s.dll' failed



And there is no such __imp__GetProcAddress symbol defined in libkernel32.a



$ nm -sn /lib/w32api/libkernel32.a |grep GetProcAddress

_GetProcAddress@8 in degqcs00553.o

__imp__GetProcAddress@8 in degqcs00553.o

00000000 I __imp__GetProcAddress@8

00000000 T _GetProcAddress@8



i confirmed that 4.8.0 20121002 has no problem like this

$ gcc -v test.c

Using built-in specs.

COLLECT_GCC=gcc

COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-pc-cygwin/4.8.0/lto-wrapper.exe

Target: i686-pc-cygwin

Configured with: ./configure --config-cache --prefix=/usr

--disable-win32-registry --enable-threads=win32

--enable-languages=c,c++,lto,fortran --with-win32-nlsapi=unicode --enable-tls

--disable-bootstrap --enable-shared --disable-sjlj-exceptions --enable-gomp

--enable-cloog-backend=isl LTLDFLAGS=-no-undefined

lt_cv_deplibs_check_method=pass_all

Thread model: win32

gcc version 4.8.0 20121002 (experimental) (GCC)

COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'

 /usr/libexec/gcc/i686-pc-cygwin/4.8.0/cc1.exe -quiet -v -D__CYGWIN32__

-D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter

/usr/lib/gcc/i686-pc-cygwin/4.8.0/../../../../i686-pc-cygwin/lib/../include/w32api

-idirafter

/usr/lib/gcc/i686-pc-cygwin/4.8.0/../../../../i686-pc-cygwin/lib/../../include/w32api

test.c -quiet -dumpbase test.c -mtune=generic -march=pentiumpro -auxbase test

-version -o /tmp/ccI4wcdv.s

GNU C (GCC) version 4.8.0 20121002 (experimental) (i686-pc-cygwin)

        compiled by GNU C version 4.8.0 20120821 (experimental), GMP version

5.0.2, MPFR version 3.2.0-dev, MPC version 0.9

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096

ignoring duplicate directory "/usr/include"

ignoring duplicate directory

"/usr/lib/gcc/i686-pc-cygwin/4.8.0/../../../../i686-pc-cygwin/lib/../../include/w32api"

#include "..." search starts here:

#include <...> search starts here:

 /usr/lib/gcc/i686-pc-cygwin/4.8.0/include

 /usr/local/include

 /usr/lib/gcc/i686-pc-cygwin/4.8.0/include-fixed

 /usr/lib/gcc/i686-pc-cygwin/4.8.0/../../../../i686-pc-cygwin/include



/usr/lib/gcc/i686-pc-cygwin/4.8.0/../../../../i686-pc-cygwin/lib/../include/w32api

End of search list.

GNU C (GCC) version 4.8.0 20121002 (experimental) (i686-pc-cygwin)

        compiled by GNU C version 4.8.0 20120821 (experimental), GMP version

5.0.2, MPFR version 3.2.0-dev, MPC version 0.9

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096

Compiler executable checksum: 4fdb453191245336128bbd0e0e482746

COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'

 /usr/lib/gcc/i686-pc-cygwin/4.8.0/../../../../i686-pc-cygwin/bin/as.exe -o

/tmp/ccvHU8m1.o /tmp/ccI4wcdv.s

COMPILER_PATH=/usr/libexec/gcc/i686-pc-cygwin/4.8.0/:/usr/libexec/gcc/i686-pc-cygwin/4.8.0/:/usr/libexec/gcc/i686-pc-cygwin/:/usr/lib/gcc/i686-pc-cygwin/4.8.0/:/usr/lib/gcc/i686-pc-cygwin/:/usr/lib/gcc/i686-pc-cygwin/4.8.0/../../../../i686-pc-cygwin/bin/

LIBRARY_PATH=/usr/lib/gcc/i686-pc-cygwin/4.8.0/:/usr/lib/gcc/i686-pc-cygwin/4.8.0/../../../../i686-pc-cygwin/lib/:/usr/lib/gcc/i686-pc-cygwin/4.8.0/../../../:/lib/:/usr/lib/

COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'

 /usr/libexec/gcc/i686-pc-cygwin/4.8.0/collect2.exe --wrap _Znwj --wrap _Znaj

--wrap _ZdlPv --wrap _ZdaPv --wrap _ZnwjRKSt9nothrow_t --wrap

_ZnajRKSt9nothrow_t --wrap _ZdlPvRKSt9nothrow_t --wrap _ZdaPvRKSt9nothrow_t

-Bdynamic --dll-search-prefix=cyg -tsaware

/usr/lib/gcc/i686-pc-cygwin/4.8.0/../../../../i686-pc-cygwin/lib/crt0.o

/usr/lib/gcc/i686-pc-cygwin/4.8.0/crtbegin.o

-L/usr/lib/gcc/i686-pc-cygwin/4.8.0

-L/usr/lib/gcc/i686-pc-cygwin/4.8.0/../../../../i686-pc-cygwin/lib

-L/usr/lib/gcc/i686-pc-cygwin/4.8.0/../../.. /tmp/ccvHU8m1.o -lgcc -lgcc_eh

-lcygwin -ladvapi32 -lshell32 -luser32 -lkernel32 -lgcc -lgcc_eh

/usr/lib/gcc/i686-pc-cygwin/4.8.0/crtend.o



but in 4.8.0 20121113, linker complains about undefined symbol.



$ /tmp/gcc/host-i686-pc-cygwin/gcc/xgcc -B/tmp/gcc/host-i686-pc-cygwin/gcc/

-B/usr/i686-pc-cygwin/bin/ -B/usr/i686-pc-cygwin/lib/ -isystem

/usr/i686-pc-cygwin/include -isystem /usr/i686-pc-cygwin/sys-include -L

/lib/gcc/i686-pc-cygwin/4.8.0 -L /lib/w32api test.c -v

Reading specs from /tmp/gcc/host-i686-pc-cygwin/gcc/specs

COLLECT_GCC=/tmp/gcc/host-i686-pc-cygwin/gcc/xgcc

COLLECT_LTO_WRAPPER=/tmp/gcc/host-i686-pc-cygwin/gcc/lto-wrapper.exe

Target: i686-pc-cygwin

Configured with: ./configure --config-cache --enable-plugin --prefix=/usr

--disable-win32-registry --enable-threads=win32

--enable-languages=c,c++,lto,fortran --with-win32-nlsapi=unicode --enable-tls

--disable-bootstrap --enable-shared --disable-sjlj-exceptions --enable-gomp

--enable-cloog-backend=isl LTLDFLAGS=-no-undefined

lt_cv_deplibs_check_method=pass_all : (reconfigured) ./configure --config-cache

--enable-plugin --prefix=/usr --disable-win32-registry --enable-threads=win32

--enable-languages=c,c++,lto,fortran --with-win32-nlsapi=unicode --enable-tls

--disable-bootstrap --enable-shared --disable-sjlj-exceptions --enable-gomp

--enable-cloog-backend=isl LTLDFLAGS=-no-undefined

lt_cv_deplibs_check_method=pass_all : (reconfigured) ./configure --config-cache

--prefix=/usr --disable-win32-registry --enable-threads=win32

--enable-languages=c,c++,lto,fortran --with-win32-nlsapi=unicode --enable-tls
--disable-bootstrap --enable-shared --disable-sjlj-exceptions --enable-gomp

--enable-cloog-backend=isl LTLDFLAGS=-no-undefined

lt_cv_deplibs_check_method=pass_all

Thread model: win32

gcc version 4.8.0 20121113 (experimental) (GCC)

COLLECT_GCC_OPTIONS='-B' '/tmp/gcc/host-i686-pc-cygwin/gcc/' '-B'

'/usr/i686-pc-cygwin/bin/' '-B' '/usr/i686-pc-cygwin/lib/' '-isystem'

'/usr/i686-pc-cygwin/include' '-isystem' '/usr/i686-pc-cygwin/sys-include'

'-L/lib/gcc/i686-pc-cygwin/4.8.0' '-L/lib/w32api' '-v' '-mtune=generic'

'-march=pentiumpro'

 /tmp/gcc/host-i686-pc-cygwin/gcc/cc1.exe -quiet -v -iprefix

/tmp/gcc/host-i686-pc-cygwin/gcc/../lib/gcc/i686-pc-cygwin/4.8.0/ -isystem

/tmp/gcc/host-i686-pc-cygwin/gcc/include -isystem

/tmp/gcc/host-i686-pc-cygwin/gcc/include-fixed -D__CYGWIN32__ -D__CYGWIN__

-Dunix -D__unix__ -D__unix -idirafter /usr/i686-pc-cygwin/bin/../include/w32api

-idirafter /usr/i686-pc-cygwin/bin/../../include/w32api -isystem

/usr/i686-pc-cygwin/include -isystem /usr/i686-pc-cygwin/sys-include test.c

-quiet -dumpbase test.c -mtune=generic -march=pentiumpro -auxbase test -version

-o /tmp/ccVS0VM4.s

GNU C (GCC) version 4.8.0 20121113 (experimental) (i686-pc-cygwin)

        compiled by GNU C version 4.8.0 20121002 (experimental), GMP version

5.0.2, MPFR version 3.2.0-dev, MPC version 0.9

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096

ignoring nonexistent directory "/usr/i686-pc-cygwin/sys-include"

ignoring nonexistent directory

"/tmp/gcc/host-i686-pc-cygwin/gcc/../lib/gcc/i686-pc-cygwin/4.8.0/include"

ignoring nonexistent directory

"/tmp/gcc/host-i686-pc-cygwin/gcc/../lib/gcc/i686-pc-cygwin/4.8.0/include-fixed"

ignoring nonexistent directory

"/tmp/gcc/host-i686-pc-cygwin/gcc/../lib/gcc/i686-pc-cygwin/4.8.0/../../../../i686-pc-cygwin/include"

ignoring nonexistent directory

"/tmp/gcc/host-i686-pc-cygwin/gcc/../lib/gcc/../../lib/gcc/i686-pc-cygwin/4.8.0/include"

ignoring nonexistent directory

"/tmp/gcc/host-i686-pc-cygwin/gcc/../lib/gcc/../../lib/gcc/i686-pc-cygwin/4.8.0/include-fixed"

ignoring nonexistent directory

"/tmp/gcc/host-i686-pc-cygwin/gcc/../lib/gcc/../../lib/gcc/i686-pc-cygwin/4.8.0/../../../../i686-pc-cygwin/include"

ignoring duplicate directory "/usr/include"

ignoring duplicate directory "/usr/i686-pc-cygwin/bin/../../include/w32api"

#include "..." search starts here:

#include <...> search starts here:

 /tmp/gcc/host-i686-pc-cygwin/gcc/include

 /tmp/gcc/host-i686-pc-cygwin/gcc/include-fixed

 /usr/i686-pc-cygwin/include

 /usr/local/include

 /usr/i686-pc-cygwin/bin/../include/w32api

End of search list.

GNU C (GCC) version 4.8.0 20121113 (experimental) (i686-pc-cygwin)

        compiled by GNU C version 4.8.0 20121002 (experimental), GMP version

5.0.2, MPFR version 3.2.0-dev, MPC version 0.9

GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096

Compiler executable checksum: 9903509d59877aa020f3953e9fbd0d88

COLLECT_GCC_OPTIONS='-B' '/tmp/gcc/host-i686-pc-cygwin/gcc/' '-B'

'/usr/i686-pc-cygwin/bin/' '-B' '/usr/i686-pc-cygwin/lib/' '-isystem'

'/usr/i686-pc-cygwin/include' '-isystem' '/usr/i686-pc-cygwin/sys-include'

'-L/lib/gcc/i686-pc-cygwin/4.8.0' '-L/lib/w32api' '-v' '-mtune=generic'

'-march=pentiumpro'

 /tmp/gcc/host-i686-pc-cygwin/gcc/as -o /tmp/ccX395Lt.o /tmp/ccVS0VM4.s

COMPILER_PATH=/tmp/gcc/host-i686-pc-cygwin/gcc/:/usr/i686-pc-cygwin/bin/:/usr/i686-pc-cygwin/lib/

LIBRARY_PATH=/tmp/gcc/host-i686-pc-cygwin/gcc/:/usr/i686-pc-cygwin/bin/:/usr/i686-pc-cygwin/lib/:/lib/:/usr/lib/

COLLECT_GCC_OPTIONS='-B' '/tmp/gcc/host-i686-pc-cygwin/gcc/' '-B'

'/usr/i686-pc-cygwin/bin/' '-B' '/usr/i686-pc-cygwin/lib/' '-isystem'

'/usr/i686-pc-cygwin/include' '-isystem' '/usr/i686-pc-cygwin/sys-include'

'-L/lib/gcc/i686-pc-cygwin/4.8.0' '-L/lib/w32api' '-v' '-mtune=generic'

'-march=pentiumpro'

 /tmp/gcc/host-i686-pc-cygwin/gcc/collect2.exe --wrap _Znwj --wrap _Znaj --wrap

_ZdlPv --wrap _ZdaPv --wrap _ZnwjRKSt9nothrow_t --wrap _ZnajRKSt9nothrow_t

--wrap _ZdlPvRKSt9nothrow_t --wrap _ZdaPvRKSt9nothrow_t -Bdynamic

--dll-search-prefix=cyg -tsaware /usr/i686-pc-cygwin/lib/crt0.o

/tmp/gcc/host-i686-pc-cygwin/gcc/crtbegin.o -L/lib/gcc/i686-pc-cygwin/4.8.0

-L/lib/w32api -L/tmp/gcc/host-i686-pc-cygwin/gcc -L/usr/i686-pc-cygwin/bin

-L/usr/i686-pc-cygwin/lib /tmp/ccX395Lt.o -lgcc -lgcc_eh -lcygwin -ladvapi32

-lshell32 -luser32 -lkernel32 -lgcc -lgcc_eh

/tmp/gcc/host-i686-pc-cygwin/gcc/crtend.o

Warning: resolving __imp__GetModuleHandleA by linking to

__imp__GetModuleHandleA@4

Use --enable-stdcall-fixup to disable these warnings

Use --disable-stdcall-fixup to disable these fixups

/tmp/gcc/host-i686-pc-cygwin/gcc/crtbegin.o:cygming-crtbegin.c:(.text+0x2f):

undefined reference to `__imp__GetProcAddress'

/tmp/gcc/host-i686-pc-cygwin/gcc/crtbegin.o:cygming-crtbegin.c:(.text+0x78):

undefined reference to `__imp__GetProcAddress'

/tmp/gcc/host-i686-pc-cygwin/gcc/crtbegin.o:cygming-crtbegin.c:(.text+0xcc):

undefined reference to `__imp__GetProcAddress'

/usr/i686-pc-cygwin/bin/ld: /tmp/gcc/host-i686-pc-cygwin/gcc/crtbegin.o: bad

reloc address 0x20 in section `.eh_frame'

/usr/i686-pc-cygwin/bin/ld: final link failed: Invalid operation

collect2: error: ld returned 1 exit status

Reply via email to