g++ on solaris
Alexandre Oliva
aoliva@redhat.com
Wed Feb 14 19:20:00 GMT 2001
On Feb 14, 2001, Patrick Mauritz <oxygene2k1@crosswinds.net> wrote:
> 1. it couldn't compile something mmap-related with g++ which worked with gcc
> the following applet (which flawlessly compiles on linux with gcc and g++)
> demonstrates it:
Why couldn't it? Maybe just because a declaration of mmap is missing?
In this case, -fpermissive would help. It's the OS headers that fail
to declare the function unless the appropriate #define is given. It
works in C89, but declarations are required in C99 and C++.
> 2. pthreads produced some confusion: on x86 and on sparc autoconf
> finds out that we need "-pthread" to compile pthread executables -
> that's not true on sparc where "-pthreads -lposix4" is needed no
> comment on the extra library
Huh? autoconf doesn't have any macros to decide which thread flags to
use. Maybe it's some non-standard macro used in some package you're
using?
Also note that x86 and sparc are machine architectures. There are
several operating systems that run on some variants of these
architectures. You didn't tell us which operating system you're
talkign about. Some of these operating systems may happen to support
threads, and GCC may happen to have a flag such as -pthread,
-pthreads, -mthreads, etc, to enable thread-specific machinery on
these platforms, mostly just for the sake of compatibility with the
native compilers.
> - but is there a table showing the gcc options for several
> architectures/os which flag (-pthread or -pthreads) and possibly
> which libraries are needed?
I'm afraid not. It would probably be a nice contribution. It
shouldn't be too hard to extract this information from GCC
configuration header files.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me
More information about the Gcc
mailing list