https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107612

--- Comment #2 from Rainer Orth <ro at gcc dot gnu.org> ---
Created attachment 53902
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53902&action=edit
Initial patch

The attached patch allowed the plugin to build on macOS.

I'm not really happy about it for a couple of reasons:

* It duplicates code that would better be imported from config/gcc-plugin.m4
  (or moved there, like soext).  libcc1/configure.ac and Makefile.am have yet
  another instance, conditional on DARWIN_DYNAMIC_LOOKUP.  This permanent
  (partial) duplication is one primary problem of some areas of the GCC
  code base.

* config/gcc-plugin.m4 should use config/picflag.m4 both to avoid duplicating
  PICFLAG and messing around with CFLAGS/CXXFLAGS to remove -mdynamic-pic with
  sed.  Instead, it would adding -mno-cynamic-no-pic for free (and only in one
  place), and could easily export something like PLUGINCFLAGS/PLUGiNCXXFLAGS
  and add PLUGINLDFLAGS, preferable AC_SUBST'ing those itself instead of having
  the callers do it.

I've now idea if such a patch would be acceptable in stage 3, though.
  PICLDFLAGS

Reply via email to