public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/32799] Multiple definitions of __flockfile when compiling an openMP program
  2007-07-17 19:21 [Bug c/32799] New: Multiple definitions of __flockfile when compiling an openMP program geir at cray dot com
@ 2007-07-17 19:21 ` geir at cray dot com
  2007-07-17 19:23 ` geir at cray dot com
  1 sibling, 0 replies; 3+ messages in thread
From: geir at cray dot com @ 2007-07-17 19:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from geir at cray dot com  2007-07-17 19:21 -------


*** This bug has been marked as a duplicate of 32798 ***


-- 

geir at cray dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


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

* [Bug c/32799]  New: Multiple definitions of __flockfile when compiling an openMP program
@ 2007-07-17 19:21 geir at cray dot com
  2007-07-17 19:21 ` [Bug c/32799] " geir at cray dot com
  2007-07-17 19:23 ` geir at cray dot com
  0 siblings, 2 replies; 3+ messages in thread
From: geir at cray dot com @ 2007-07-17 19:21 UTC (permalink / raw)
  To: gcc-bugs

I see the following behavior when compiling an OpenMP program:

$ cat omp.c

extern void omp_set_num_threads (int);
#define NT 4

int main() {
    omp_set_num_threads(NT);
    return(0);
}

$ gcc --version
gcc (GCC) 4.2.0 20070514 (rpm:4)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ gcc -static -fopenmp omp.c -lc
/usr/lib/../lib64/libpthread.a(lockfile.o)(.text+0xb0): In function
`__flockfile':
/usr/src/packages/BUILD/glibc-2.3/linuxthreads/lockfile.c:29: multiple
definition of `_IO_flockfile'
/usr/lib/../lib64/libc.a(flockfile.o)(.text+0x0):../linuxthreads/sysdeps/pthread/flockfile.c:30:
first defined here
/usr/bin/ld: Warning: size of symbol `_IO_flockfile' changed from 24 in
/usr/lib/../lib64/libc.a(flockfile.o) to 12 in
/usr/lib/../lib64/libc.a(flockfile.o)
/usr/lib/../lib64/libpthread.a(lockfile.o)(.text+0xb0): In function
`__flockfile':
/usr/src/packages/BUILD/glibc-2.3/linuxthreads/lockfile.c:29: multiple
definition of `__flockfile'
/usr/lib/../lib64/libc.a(flockfile.o)(.text+0x0):../linuxthreads/sysdeps/pthread/flockfile.c:30:
first defined here
/usr/bin/ld: Warning: size of symbol `__flockfile' changed from 24 in
/usr/lib/../lib64/libc.a(flockfile.o) to 12 in
/usr/lib/../lib64/libc.a(flockfile.o)
/usr/lib/../lib64/libpthread.a(lockfile.o)(.text+0xa0): In function
`__funlockfile':
/usr/src/packages/BUILD/glibc-2.3/linuxthreads/lockfile.c:39: multiple
definition of `_IO_funlockfile'
/usr/lib/../lib64/libc.a(funlockfile.o)(.text+0x0):../linuxthreads/sysdeps/pthread/funlockfile.c:30:
first defined here
/usr/bin/ld: Warning: size of symbol `_IO_funlockfile' changed from 24 in
/usr/lib/../lib64/libc.a(funlockfile.o) to 12 in
/usr/lib/../lib64/libc.a(funlockfile.o)
/usr/lib/../lib64/libpthread.a(lockfile.o)(.text+0xa0): In function
`__funlockfile':
/usr/src/packages/BUILD/glibc-2.3/linuxthreads/lockfile.c:39: multiple
definition of `__funlockfile'
/usr/lib/../lib64/libc.a(funlockfile.o)(.text+0x0):../linuxthreads/sysdeps/pthread/funlockfile.c:30:
first defined here
/usr/bin/ld: Warning: size of symbol `__funlockfile' changed from 24 in
/usr/lib/../lib64/libc.a(funlockfile.o) to 12 in
/usr/lib/../lib64/libc.a(funlockfile.o)collect2: ld returned 1 exit status
$

Problem does NOT occur if I don't include '-lc'.  I don't quite understand why
this is a factor, since gcc automatically specifies '-lc' when linking the
program.  Please enlighten me as to why adding this to the command line causes
the error.

Here is the version of Linux I am using:

$ uname -a
Linux guppy2 2.6.5-7.286-ss #6 SMP Wed Jul 11 14:28:20 PDT 2007 x86_64 x86_64
x86_64 GNU/Linux
$ cat /etc/SuSE-release
SUSE LINUX Enterprise Server 9 (x86_64)
VERSION = 9
PATCHLEVEL = 2
$

I am building a program for the Cray XT3, so static libraries must be used.


-- 
           Summary: Multiple definitions of __flockfile when compiling an
                    openMP program
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: geir at cray dot com


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


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

* [Bug c/32799] Multiple definitions of __flockfile when compiling an openMP program
  2007-07-17 19:21 [Bug c/32799] New: Multiple definitions of __flockfile when compiling an openMP program geir at cray dot com
  2007-07-17 19:21 ` [Bug c/32799] " geir at cray dot com
@ 2007-07-17 19:23 ` geir at cray dot com
  1 sibling, 0 replies; 3+ messages in thread
From: geir at cray dot com @ 2007-07-17 19:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from geir at cray dot com  2007-07-17 19:22 -------
Pressing refresh on my browser mistakenly opened up a new bug for the problem
described in bug 32798


-- 


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


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

end of thread, other threads:[~2007-07-17 19:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-17 19:21 [Bug c/32799] New: Multiple definitions of __flockfile when compiling an openMP program geir at cray dot com
2007-07-17 19:21 ` [Bug c/32799] " geir at cray dot com
2007-07-17 19:23 ` geir at cray dot com

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).