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]
Other format: [Raw text]

Re: [Patch][GCC] Document and fix -r (partial linking)


Hi Allan,

> On 3 Aug 2018, at 12:56, Allan Sandfeld Jensen <linux@carewolf.com> wrote:
> 
> On Mittwoch, 1. August 2018 18:32:30 CEST Joseph Myers wrote:
>> On Wed, 1 Aug 2018, Allan Sandfeld Jensen wrote:
>>> gcc/
> 

> 2018-07-29 Allan Sandfeld Jensen <allan.jensen@qt.io>
> 
> gcc/doc
> 
>    * invoke.texi: Document -r
> 
> gcc/
>    * gcc.c (LINK_COMMAND_SPEC): Handle -r like -nostdlib
>    * config/darwin.h (LINK_COMMAND_SPEC): Handle -r like -nostdlib
> ---
> gcc/config/darwin.h | 8 ++++----
> gcc/doc/invoke.texi | 7 ++++++-
> gcc/gcc.c           | 6 +++---
> 3 files changed, 13 insertions(+), 8 deletions(-)
> 
> diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
> index 980ad9b4057..6ad657a4958 100644
> --- a/gcc/config/darwin.h
> +++ b/gcc/config/darwin.h
> @@ -178,20 +178,20 @@ extern GTY(()) int darwin_ms_struct;
>    "%X %{s} %{t} %{Z} %{u*} \
>     %{e*} %{r} \
>     %{o*}%{!o:-o a.out} \
> -    %{!nostdlib:%{!nostartfiles:%S}} \
> +    %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
>     %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} \
>     %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1): \
>       %{static|static-libgcc|static-libstdc++|static-libgfortran: libgomp.a%s; : -lgomp } } \
>     %{fgnu-tm: \
>       %{static|static-libgcc|static-libstdc++|static-libgfortran: libitm.a%s; : -litm } } \
> -    %{!nostdlib:%{!nodefaultlibs:\
> +    %{!nostdlib:%{!r:%{!nodefaultlibs:\
>       %{%:sanitize(address): -lasan } \
>       %{%:sanitize(undefined): -lubsan } \
>       %(link_ssp) \
>       " DARWIN_EXPORT_DYNAMIC " %<rdynamic \
>       %(link_gcc_c_sequence) \
> -    }}\
> -    %{!nostdlib:%{!nostartfiles:%E}} %{T*} %{F*} }}}}}}}"
> +    }}}\
> +    %{!nostdlib:%{!r:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}"
> 
> #define DSYMUTIL "\ndsymutil”

The Darwin part looks reasonable to me.
Thanks for doing this,
Iain




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