This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add -nolibc option
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Tristan Gingold <gingold at adacore dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 2 Aug 2017 11:33:22 +0000
- Subject: Re: [PATCH] Add -nolibc option
- Authentication-results: sourceware.org; auth=none
- References: <5a6784e2-834d-ab1d-e453-2b117a4e0bff@adacore.com>
On Thu, 27 Jul 2017, Tristan Gingold wrote:
> Index: gcc/common.opt
> ===================================================================
> --- gcc/common.opt (revision 250563)
> +++ gcc/common.opt (working copy)
> @@ -2956,6 +2956,10 @@
> nostdlib
> Driver
>
> +nolibc
> +Driver
> +Do not link with libc
Help texts should end with ".". This may not cause a test failure in this
particular case because help texts for Driver options aren't actually used
(and the test for help text formatting checks the --help output, not the
.opt files); you actually need to update gcc.c:display_help to get a help
text in the driver's --help output.
Since none of the related options such as -nostdlib are mentioned in that
--help output, either removing the help text or adding "." would seem
appropriate. Or add all those options to --help output separately.
> Index: gcc/config/arm/unknown-elf.h
> ===================================================================
> --- gcc/config/arm/unknown-elf.h (revision 250563)
> +++ gcc/config/arm/unknown-elf.h (working copy)
> @@ -91,6 +91,6 @@
> /* The libgcc udivmod functions may throw exceptions. If newlib is
> configured to support long longs in I/O, then printf will depend on
> udivmoddi4, which will depend on the exception unwind routines,
> - which will depend on abort, which is defined in libc. */
> + which will depend on abort, which is defined in libc. */
> #undef LINK_GCC_C_SEQUENCE_SPEC
> -#define LINK_GCC_C_SEQUENCE_SPEC "--start-group %G %L --end-group"
> +#define LINK_GCC_C_SEQUENCE_SPEC "--start-group %G %{!nolibc:%L} --end-group"
There are lots of other LINK_GCC_C_SEQUENCE_SPEC definitions for
particular targets I'd expect to be updated.
--
Joseph S. Myers
joseph@codesourcery.com