Compiling CAMx_v4.20, i'm getting:

/usr/bin/ld: equk_: TLS reference in ./CF_AERO/isocom_v1.6.o mismatches non-TLS
reference in ./CMU_AERO/diffund.o
./CMU_AERO/diffund.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [model] Error 1
make[1]: Leaving directory `/home/cow/src/CAMX/CAMx_Bench/CAMx_v4.20/src'
make: *** [gfortran_linuxomp] Error 2


The error stems from a common that is used $omp threadprivate in one file and
without annotation in another file (which may be an application glitch but
ifort deals with this nicely):

$ cat inc1.inc
        COMMON /EQUK/ XK1
c$omp threadprivate(/EQUK/)
$ cat inc2.inc
        COMMON /EQUK/ XK1
$ cat sub1.f
        SUBROUTINE sub1
        INCLUDE 'inc1.inc'
        END SUBROUTINE sub1
$ cat sub2.f
        SUBROUTINE sub2
        INCLUDE 'inc2.inc'
        END SUBROUTINE sub2
$ cat main.f
        call sub1
        call sub2
        END
$ cat Makefile
all: sub1.o sub2.o main.o
        $(FC) $^


$ make FC=gfortran-4.2.orig-HEAD FFLAGS=-fopenmp
gfortran-4.2.orig-HEAD -fopenmp  -c -o sub1.o sub1.f
gfortran-4.2.orig-HEAD -fopenmp  -c -o sub2.o sub2.f
gfortran-4.2.orig-HEAD -fopenmp  -c -o main.o main.f
gfortran-4.2.orig-HEAD sub1.o sub2.o main.o
/usr/bin/ld: equk_: TLS reference in sub1.o mismatches non-TLS reference in
sub2.o
sub2.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [all] Error 1


$ gfortran-4.2.orig-HEAD -v
Using built-in specs.
Target: i686-linux-gnu
Configured with: ../../src/gcc-4.2.orig/configure -v
--enable-languages=c,c++,fortran,treelang --prefix=/opt/gcc-4.2.orig/
--enable-shared --with-system-zlib --libexecdir=/opt/gcc-4.2.orig/lib
--enable-nls --without-included-gettext --enable-threads=posix
--program-suffix=-4.2.orig-HEAD --enable-__cxa_atexit
--enable-libstdcxx-allocator=mt --enable-clocale=gnu --disable-libstdcxx-debug
--enable-mpfr --disable-werror --enable-checking=release --enable-debug
i686-linux-gnu
Thread model: posix
gcc version 4.2.0 20060930 (experimental)


-- 
           Summary: TLS / non-TLS mismatch for COMMON declared in both ways
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgomp
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rep dot nop at aon dot at
 GCC build triplet: i686-linux-gnu
  GCC host triplet: i686-linux-gnu
GCC target triplet: i686-linux-gnu


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

Reply via email to