public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: gcc-patches@gcc.gnu.org, binutils@sourceware.org
Cc: David Malcolm <dmalcolm@redhat.com>
Subject: [PATCH 13/16] ld/Makefile.am: Introduce a libld.la
Date: Mon, 01 Jun 2015 21:00:00 -0000	[thread overview]
Message-ID: <1433192664-50156-14-git-send-email-dmalcolm@redhat.com> (raw)
In-Reply-To: <1433192664-50156-1-git-send-email-dmalcolm@redhat.com>

Similarly to "libgas.la" before , this introduces a libld.la, moving
everything from "ld" into it, with ld built from ldmainmain.c.

As before with the libgas.la patch, this patch isn't ready yet, but
seems to be good enough for prototyping the libgccjit.so integration.
---
 ld/Makefile.am | 64 ++++++++++++++++++++++++----------------------------------
 1 file changed, 26 insertions(+), 38 deletions(-)

diff --git a/ld/Makefile.am b/ld/Makefile.am
index 55b62c5..71e4f8a 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -40,6 +40,7 @@ ELF_CLFAGS=-DELF_LIST_OPTIONS=@elf_list_options@ \
 WARN_CFLAGS = @WARN_CFLAGS@
 NO_WERROR = @NO_WERROR@
 AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS)
+CFLAGS +=-fPIC
 
 # Conditionally enable the plugin interface.
 if ENABLE_PLUGINS
@@ -132,11 +133,14 @@ CXX_FOR_TARGET = ` \
 
 transform = s/^ld-new$$/$(installed_linker)/;@program_transform_name@
 bin_PROGRAMS = ld-new
+lib_LTLIBRARIES = libld.la
 info_TEXINFOS = ld.texinfo
 ld_TEXINFOS = configdoc.texi
 noinst_TEXINFOS = ldint.texinfo
 man_MANS = ld.1
 
+include_HEADERS = libld.h
+
 AM_MAKEINFOFLAGS = -I $(srcdir) -I $(BFDDIR)/doc -I ../bfd/doc \
 		   -I $(top_srcdir)/../libiberty
 TEXI2DVI = texi2dvi -I $(srcdir) -I $(BFDDIR)/doc -I ../bfd/doc \
@@ -583,42 +587,23 @@ po/POTFILES.in: @MAINT@ Makefile
 	for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
 	  && mv tmp $(srcdir)/po/POTFILES.in
 
-ldmain.@OBJEXT@: ldmain.c config.status
-if am__fastdepCC
-	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ \
+# FIXME:
+#   ldmain.lo wants:
+#     -DDEFAULT_EMULATION='"$(EMUL)"' \
+#     -DBINDIR='"$(bindir)"' -DTOOLBINDIR='"$(tooldir)/bin"' \
+#     -DTARGET='"@target@"' @TARGET_SYSTEM_ROOT_DEFINE@
+#
+#   ldfile.lo wants:
+#     -DSCRIPTDIR='"$(scriptdir)"' -DBINDIR='"$(bindir)"' -DTOOLBINDIR='"$(tooldir)/bin"'
+#
+# Here we combine them all:
+AM_CFLAGS += \
 	  -DDEFAULT_EMULATION='"$(EMUL)"' \
 	  -DBINDIR='"$(bindir)"' -DTOOLBINDIR='"$(tooldir)/bin"' \
 	  -DTARGET='"@target@"' @TARGET_SYSTEM_ROOT_DEFINE@ \
-	  $(srcdir)/ldmain.c
-	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-else
-if AMDEP
-	source='ldmain.c' object='$@' libtool=no @AMDEPBACKSLASH@
-	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-endif
-	$(COMPILE) -c -DDEFAULT_EMULATION='"$(EMUL)"' \
-	  -DBINDIR='"$(bindir)"' -DTOOLBINDIR='"$(tooldir)/bin"' \
-	  -DTARGET='"@target@"' @TARGET_SYSTEM_ROOT_DEFINE@ \
-	  $(srcdir)/ldmain.c
-endif
+	  -DSCRIPTDIR='"$(scriptdir)"'
 
-ldfile.@OBJEXT@: ldfile.c config.status
-if am__fastdepCC
-	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ \
-	-DSCRIPTDIR='"$(scriptdir)"' -DBINDIR='"$(bindir)"' -DTOOLBINDIR='"$(tooldir)/bin"' \
-	 $(srcdir)/ldfile.c
-	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-else
-if AMDEP
-	source='ldfile.c' object='$@' libtool=no @AMDEPBACKSLASH@
-	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-endif
-	$(COMPILE) -c -DSCRIPTDIR='"$(scriptdir)"' -DBINDIR='"$(bindir)"' \
-	  -DTOOLBINDIR='"$(tooldir)/bin"' \
-	  $(srcdir)/ldfile.c
-endif
-
-eelf32_spu.@OBJEXT@: eelf32_spu.c
+eelf32_spu.lo: eelf32_spu.c
 if am__fastdepCC
 	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ \
 	  -DEMBEDSPU="\"`echo embedspu | sed '$(transform)'`\"" eelf32_spu.c
@@ -1999,19 +1984,22 @@ eshlelf64_nbsd.c: $(srcdir)/emulparams/shlelf64_nbsd.sh \
 
 
 # We need this for automake to use YLWRAP.
-EXTRA_ld_new_SOURCES = deffilep.y ldlex.l
+EXTRA_libld_la_SOURCES = deffilep.y ldlex.l
 # Allow dependency tracking to work for these files, too.
-EXTRA_ld_new_SOURCES += pep-dll.c pe-dll.c
+EXTRA_libld_la_SOURCES += pep-dll.c pe-dll.c
+
+ld_new_SOURCES = ldmainmain.c
 
-ld_new_SOURCES = ldgram.y ldlex-wrapper.c lexsup.c ldlang.c mri.c ldctor.c ldmain.c \
+libld_la_SOURCES = ldgram.y ldlex-wrapper.c lexsup.c ldlang.c mri.c ldctor.c ldmain.c \
 	ldwrite.c ldexp.c ldemul.c ldver.c ldmisc.c ldfile.c ldcref.c $(PLUGIN_C) \
 	ldbuildid.c
-ld_new_DEPENDENCIES = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) \
+libld_la_DEPENDENCIES = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) \
 		      $(BFDLIB) $(LIBIBERTY) $(LIBINTL_DEP)
-ld_new_LDADD = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL)
+libld_la_LIBADD =  $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL)
+ld_new_LDADD = libld.la
 
 # Dependency tracking for the generated emulation files.
-EXTRA_ld_new_SOURCES += $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES)
+EXTRA_libld_la_SOURCES += $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES)
 
 # This is the real libbfd.a created by libtool.
 TESTBFDLIB = @TESTBFDLIB@
-- 
1.8.5.3

  parent reply	other threads:[~2015-06-01 21:00 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01 20:50 [PATCH 00/16] RFC: Embedding as and ld inside gcc driver and into libgccjit David Malcolm
2015-06-01 20:50 ` [PATCH 01/16] gcc: Generalization of timevar API; add gcc_jit_timer interface David Malcolm
2015-06-01 20:50 ` [PATCH 05/16] gcc: driver: add g_driver singleton David Malcolm
2015-06-01 20:51 ` [PATCH 15/16] gcc: Use libgas and libld within the driver David Malcolm
2015-06-02  8:32   ` Richard Biener
2015-06-02 11:07     ` Trevor Saunders
2015-06-02 12:12       ` Richard Biener
2015-06-01 20:51 ` [PATCH 10/16] binutils: Introduce "gas_main", and state-purging with "gas" subdir David Malcolm
2015-06-01 20:55 ` [PATCH 08/16] libiberty.h: Provide a CLEAR_VAR macro David Malcolm
2015-06-01 21:47   ` DJ Delorie
2015-06-02  1:23     ` David Malcolm
2015-06-02  1:39       ` DJ Delorie
2015-06-01 20:55 ` [PATCH 09/16] libiberty.h: Provide CTIMER_PUSH/POP David Malcolm
2015-06-01 21:30   ` DJ Delorie
2015-06-02 21:52     ` Jeff Law
2015-06-01 20:55 ` [PATCH 06/16] gcc: driver: add timevars for as, collect2, ld David Malcolm
2015-06-01 20:55 ` [PATCH 07/16] binutils: bfd: Implement bfd_uninit David Malcolm
2015-06-01 20:56 ` [PATCH 04/16] gcc: Don't keep reinitializing RTL David Malcolm
2015-06-01 20:58 ` [PATCH 11/16] binutils: gas/Makefile.am: Add libgas.la David Malcolm
2015-06-01 20:58 ` [PATCH 14/16] gcc: Add CTIMER_PUSH/POP to gcc's copy of libiberty David Malcolm
2015-06-01 21:33   ` DJ Delorie
2015-06-01 20:58 ` [PATCH 02/16] gcc: Embed the driver in-process within libgccjit David Malcolm
2015-06-03  6:00   ` Bert Wesarg
2015-06-01 20:59 ` [PATCH 12/16] binutils: Introduce "ld_main" and state-purging within "ld" subdir David Malcolm
2015-06-01 20:59 ` [PATCH 03/16] gcc: Use timevars within driver David Malcolm
2015-06-01 21:00 ` David Malcolm [this message]
2015-06-01 21:00 ` [PATCH 16/16] gcc: Hack up the arguments to the linker David Malcolm

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=1433192664-50156-14-git-send-email-dmalcolm@redhat.com \
    --to=dmalcolm@redhat.com \
    --cc=binutils@sourceware.org \
    --cc=gcc-patches@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: link
Be 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).