Add GNU -bsd option from specs to new gnu.opt

Thomas Schwinge thomas@schwinge.name
Mon Feb 7 00:13:00 GMT 2011


Hallo!

Roland, Thomas, Samuel: Do you have any comments on this (read below)?
(Originally: <http://gcc.gnu.org/ml/gcc-patches/2011-01/msg02072.html>,
<http://gcc.gnu.org/ml/gcc-patches/2011-02/msg00206.html>)


On Fri, Jan 28, 2011 at 12:06:48AM +0000, Joseph S. Myers wrote:
> In preparation for the driver only accepting options listed in .opt
> files, and not other options that simply happen to match some spec,
> this patch adds the -bsd option accepted by specs in gnu.h to a new
> gnu.opt file.

> (Other options are not added to this file because
> <http://gcc.gnu.org/ml/gcc-patches/2011-01/msg02024.html> adds them to
> gnu-user.opt

Ack.

> Index: gcc/config.gcc
> ===================================================================
> --- gcc/config.gcc	(revision 169317)
> +++ gcc/config.gcc	(working copy)
> @@ -561,6 +561,9 @@ case ${target} in
>    case $target in
>      *linux*)
>        extra_options="$extra_options linux.opt";;
> +    *-*-gnu*)
> +      tm_defines="$tm_defines SINGLE_LIBC"
> +      extra_options="$extra_options gnu.opt";;
>      *)
>        tm_defines="$tm_defines SINGLE_LIBC";;
>    esac

This would also match k*bsd-gnu*, etc. -- which don't have a -bsd option
as far as I can tell -- I only find it in three places:

    config/gnu.h:#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{bsd:-D_BSD_SOURCE}"
    config/gnu.h:#define LIB_SPEC "%{pthread:-lpthread} %{bsd:-lbsd-compat} %{pg|p|profile:-lc_p;:-lc}"
    config/i386/gnu.h:#define CPP_SPEC "%{pthread:-D_REENTRANT} %{posix:-D_POSIX_SOURCE} %{bsd:-D_BSD_SOURCE}"

So, I wondered what this -bsd option was actually about.  (I already
wondered months (uhm, years...) ago, but didn't look it up back then.)

This spec code was added with the original GNU/Hurd spec files commit by
Roland in 1994.  Roland, can you tell where you meant to / did use this
option (apart from a local command-line argument shortcut)?

The only place I can remotely find it referenced in core Hurd-related
source code is in glibc, and here it (that is, libbsd-compat) has been an
empty dummy library as of 1998-04-21.  [glibc]/NOTES has a description of
this in the ``Macro: _BSD_SOURCE'' section (but doesn't talk about a -bsd
option either).

There might be some third-party software that uses the -bsd option
(exclusively) for GNU/Hurd, but I don't think this is anywhere near
realistical, and if that softwares' builds failed loudly passing this
option to GCC (and be fixed afterwards), I'd consider that fine -- I
therefore propose removing this -bsd option right away instead of
spending any more time on it.


Grüße,
 Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110207/3fe4e79f/attachment.sig>


More information about the Gcc-patches mailing list