This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PATCH: Support the FreeBSD 5.0 system thread library model


In article <20010511190337.D60085@dragon.nuxi.com>,
"David O'Brien" <obrien@freebsd.org> writes:

> I considered a very simular patch, but will this be accepted?

If it breaks cross-compiling, then it should be rejected.

> It won't build in a cross environment.

Yup, you appear to be right, with my quick test, this patch does break
cross-compiling when FreeBSD is the target.  Humm, I wonder how many
ports whose config files include unistd.h (or other files outside
[...]/config) are also broken...

> I think maybe we may have to set a knob in configure for
> ``*-*-freebsd([5-9]|[5-9].*)''.  I would not care about older
> versions of FreeBSD 5-CURRENT -- it is an in-development version and
> if you're running it you are expected to be able to handle thinks
> like this on your own.

Oh joy.  You had done so well at making all ELF versions of FreeBSD
use the same configuration files.  It appears that they will have to
be version'd to handle this one issue.

Would you support breaking out just the setting of LIB_SPEC (from
config/freebsd.h) to its own file?

In light of this discussion and another long-term pet-peeve of mine
(related to mishandling the -pthread option when gcc was configured
without --enable-thread), I see three versions of LIB_SPEC:

A default LIB_SPEC retained in config/freebsd.h.  And two new LIB_SPEC
override files in the style of config/tm-dwarf2.h:

config/freebsd-LIB_SPEC-pthread-exclusive-use.h
config/freebsd-LIB_SPEC-pthread-with-libc.h

The retained version would support us when people configure with
--disable-threads.  Using a feature of spec files, we can print an
error message when people attempt to compile with the -pthread option.

The two versions in external override files would support the two
versions of the threading model.

The keying logic to decide which to use goes in gcc/config.gcc (here
is one partially updated version):

i[34567]86-*-freebsd[34]*)
        tm_file="i386/i386.h i386/att.h svr4.h freebsd.h i386/freebsd.h i386/perform.h"
        extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
        tmake_file=t-freebsd
        gas=yes
        gnu_ld=yes
        case x${enable_threads} in
        xyes | xpthreads | xposix)
                thread_file='posix'
                tmake_file="${tmake_file} t-freebsd-thread"
		tm_file="${tm_file} freebsd-LIB_SPEC-pthread-exclusive-use.h"
                ;;
        esac
        ;;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]