Message ID | yddfvj5i0mc.fsf@lokon.CeBiTec.Uni-Bielefeld.DE |
---|---|
State | New |
Headers | show |
On Mon, Jun 16, 2014 at 3:56 AM, Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote: > > Works fine, thanks. Just before your patch arrived, I meant to test the > following, slightly more general patch. Perhaps it's an option to > handle other quirks like this? This approach is fine with me, but the target macro should be documented somwhere. We need to document that multiple options have to be separated with commas, not spaces. Ian
On Mon, Jun 16, 2014 at 6:58 AM, Ian Lance Taylor <iant@google.com> wrote: > On Mon, Jun 16, 2014 at 3:56 AM, Rainer Orth > <ro@cebitec.uni-bielefeld.de> wrote: >> >> Works fine, thanks. Just before your patch arrived, I meant to test the >> following, slightly more general patch. Perhaps it's an option to >> handle other quirks like this? > > This approach is fine with me, but the target macro should be > documented somwhere. We need to document that multiple options have > to be separated with commas, not spaces. Also I think it would be better to write it along the lines of the following, to allow runtime determination of whether the option is needed. #ifdef TARGET_GO_LINK_OPTIONS /* Pass target specific linker options if present. */ { const char *p = TARGET_GO_LINK_OPTIONS; if (p != NULL && *p != '\0') generate_option (OPT_Wl_, TARGET_GO_LINK_OPTIONS, 1, CL_DRIVER, &new_decoded_options[j++]); } #endif Ian
# HG changeset patch # Parent 59e0e6f1eecd53ddab49b2cd5015be221b5e505a Suppress Solaris ld warnings about go$zerovalue sizes (PR go/61496) diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h --- a/gcc/config/sol2.h +++ b/gcc/config/sol2.h @@ -303,6 +303,12 @@ along with GCC; see the file COPYING3. /* collect2.c can only parse GNU nm -n output. Solaris nm needs -png to produce the same format. */ #define NM_FLAGS "-png" + +#ifndef USE_GLD +/* Solaris ld warns about common symbols of differing sizes, which Go uses + for go$zerovalue. Pass -t to suppress that warning. */ +#define TARGET_GO_LINK_OPTIONS "-t" +#endif /* The system headers under Solaris 2 are C++-aware since 2.0. */ #define NO_IMPLICIT_EXTERN_C diff --git a/gcc/go/gospec.c b/gcc/go/gospec.c --- a/gcc/go/gospec.c +++ b/gcc/go/gospec.c @@ -395,6 +395,12 @@ lang_specific_driver (struct cl_decoded_ } #endif +#ifdef TARGET_GO_LINK_OPTIONS + /* Pass target specific linker options if present. */ + generate_option (OPT_Wl_, TARGET_GO_LINK_OPTIONS, 1, CL_DRIVER, + &new_decoded_options[j++]); +#endif + *in_decoded_options_count = j; *in_decoded_options = new_decoded_options; *in_added_libraries = added_libraries;