public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Iain D Sandoe <iains@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-4451] Darwin: Update specs handling '-r'. Date: Fri, 15 Oct 2021 18:52:29 +0000 (GMT) [thread overview] Message-ID: <20211015185229.1BD643858C60@sourceware.org> (raw) https://gcc.gnu.org/g:4aef14b09557ce072f1269bd8a05fa2b1df0eda2 commit r12-4451-g4aef14b09557ce072f1269bd8a05fa2b1df0eda2 Author: Iain Sandoe <iain@sandoe.co.uk> Date: Thu Oct 7 13:55:48 2021 +0100 Darwin: Update specs handling '-r'. We were not wrapping all the default libraries in checks for whether they should be used. We were also wasting a process launch calling dsymutil for 'r' link lines (a NOP in practice). Order the checks that exclude linking from most likely to occur, downwards. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/ChangeLog: * config/darwin.h (LINK_COMMAND_SPEC_A): Update 'r' handling to skip gomp and itm when r or nodefaultlibs is given. (DSYMUTIL_SPEC): Do not call dsymutil for '-r' link lines. Update ordering of exclusions, remove duplicate 'v' addition (collect2 will add this from the main command line). Diff: --- gcc/config/darwin.h | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index 4aedf467c17..27cb3e4bb30 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -349,7 +349,7 @@ extern GTY(()) int darwin_ms_struct; linkers, and for positional arguments like libraries. */ #define LINK_COMMAND_SPEC_A \ - "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ + "%{!c:%{!E:%{!S:%{!M:%{!MM:%{!fsyntax-only:%{!fdump=*: \ %(linker)" \ LINK_PLUGIN_SPEC \ "%{flto*:%<fcompare-debug*} \ @@ -358,20 +358,23 @@ extern GTY(()) int darwin_ms_struct; "%X %{s} %{t} %{Z} %{u*} \ %{e*} %{r} \ %{o*}%{!o:-o a.out} \ - %{!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:%{!r:%{!nodefaultlibs:\ + %{!r:%{!nostdlib:%{!nostartfiles:%S}}} \ + %{L*} %(link_libgcc) %o \ + %{!r:%{!nostdlib:%{!nodefaultlibs:\ + %{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 }} \ %{%:sanitize(address): -lasan } \ %{%:sanitize(undefined): -lubsan } \ %(link_ssp) \ %:version-compare(>< 10.6 10.7 mmacosx-version-min= -ld10-uwfef) \ %(link_gcc_c_sequence) \ }}}\ - %{!nostdlib:%{!r:%{!nostartfiles:%E}}} %{T*} %{F*} "\ + %{!r:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} "\ DARWIN_PIE_SPEC \ DARWIN_NOPIE_SPEC \ DARWIN_RDYNAMIC \ @@ -384,12 +387,12 @@ extern GTY(()) int darwin_ms_struct; enabled). */ #define DSYMUTIL_SPEC \ - "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ - %{v} \ - %{g*:%{!gctf:%{!gbtf:%{!gstabs*:%{%:debug-level-gt(0): -idsym}}}}}\ - %{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm|.s|.f|.f90|\ - .f95|.f03|.f77|.for|.F|.F90|.F95|.F03|.d: \ - %{g*:%{!gctf:%{!gbtf:%{!gstabs*:%{%:debug-level-gt(0): -dsym}}}}}}}}}}}}}" + "%{!c:%{!E:%{!S:%{!r:%{!M:%{!MM:%{!fsyntax-only:%{!fdump=*:\ + %{g*:%{!gctf:%{!gbtf:%{!gstabs*:%{%:debug-level-gt(0): -idsym \ + %{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm|.s|.f|.f90|\ + .f95|.f03|.f77|.for|.F|.F90|.F95|.F03|.d: -dsym }\ + }}}}}\ + }}}}}}}}" #define LINK_COMMAND_SPEC LINK_COMMAND_SPEC_A DSYMUTIL_SPEC
reply other threads:[~2021-10-15 18:52 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20211015185229.1BD643858C60@sourceware.org \ --to=iains@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).