public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgomp/56357] New: [4.8 Regression] missing symbol references for libgomp when using -flto -fopenmp on mingw32
@ 2013-02-16 19:10 daniel.f.starke at freenet dot de
  2013-02-18 10:44 ` [Bug libgomp/56357] " rguenth at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: daniel.f.starke at freenet dot de @ 2013-02-16 19:10 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56357
           Summary: [4.8 Regression] missing symbol references for libgomp
                    when using -flto -fopenmp on mingw32
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgomp
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: daniel.f.starke@freenet.de
                CC: jakub@gcc.gnu.org


The combination of -flto and -fopenmp is broken for mingw32 in r196092.

#define ARRAY_SIZE 10

int main() {
    int i;
    volatile int a[ARRAY_SIZE];
    #pragma omp parallel for private(a)
    for (i = 0; i < ARRAY_SIZE; i++) {
        a[i] += i;
    }

    return 0;
}

This code works fine with "gcc -fopenmp gcc-lto-gomp.c" but results in errors
for "gcc -fopenmp -flto gcc-lto-gomp.c". Adding -lgomp does not solves this.

Error output:
C:\Users\Me\AppData\Local\Temp\cccobKR8.ltrans0.ltrans.o:cccobKR8.ltrans0.o:(.text+0x6):
undefined reference to `omp_get_num_threads'
C:\Users\Me\AppData\Local\Temp\cccobKR8.ltrans0.ltrans.o:cccobKR8.ltrans0.o:(.text+0xd):
undefined reference to `omp_get_thread_num'
C:\Users\Me\AppData\Local\Temp\cccobKR8.ltrans0.ltrans.o:cccobKR8.ltrans0.o:(.text.startup+0x26):
undefined reference to `GOMP_parallel_start'
C:\Users\Me\AppData\Local\Temp\cccobKR8.ltrans0.ltrans.o:cccobKR8.ltrans0.o:(.text.startup+0x37):
undefined reference to `GOMP_parallel_end'
could not unlink output filecollect2.exe: error: ld returned 1 exit status

This all works fine in gcc 4.7.2 with the same build configuration.

Using built-in specs.
COLLECT_GCC=D:\Programme\msys\gcc\bin\gcc.exe
COLLECT_LTO_WRAPPER=d:/programme/msys/gcc/bin/../libexec/gcc/mingw32/4.8.0/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.8.0-r196092/configure
--enable-languages=c,ada,c++,fortran,objc,obj-c++ --disable-sjlj-exceptions
--disable-nls --disable-shared --enable-static --enable-fully-dynamic-string
--enable-libgomp --enable-lto --with-dwarf2 --disable-win32-registry
--enable-version-specific-runtime-libs --enable-bootstrap --build=mingw32
--enable-abi=32 --enable-checking=release --prefix=/mingw
Thread model: win32
gcc version 4.8.0 20130215 (experimental) (GCC)


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-10-25 12:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-16 19:10 [Bug libgomp/56357] New: [4.8 Regression] missing symbol references for libgomp when using -flto -fopenmp on mingw32 daniel.f.starke at freenet dot de
2013-02-18 10:44 ` [Bug libgomp/56357] " rguenth at gcc dot gnu.org
2013-02-18 14:25 ` jakub at gcc dot gnu.org
2013-02-20 14:49 ` rguenth at gcc dot gnu.org
2013-02-26  8:02 ` daniel.f.starke at freenet dot de
2013-03-08 20:05 ` daniel.f.starke at freenet dot de
2013-03-22 14:45 ` [Bug libgomp/56357] [4.8/4.9 " jakub at gcc dot gnu.org
2013-05-31 10:59 ` jakub at gcc dot gnu.org
2013-10-16  9:49 ` jakub at gcc dot gnu.org
2013-10-25 12:24 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).