Hi!

JIT/GCC as a shared library merged!  \o/

On Fri, 31 Oct 2014 13:02:34 -0400, David Malcolm <dmalc...@redhat.com> wrote:
> An earlier version of this was posted as:
>   "[PATCH 2/5] gcc: configure and Makefile changes needed by jit"
>     https://gcc.gnu.org/ml/gcc-patches/2014-10/msg01169.html
> 
> Since then, I've eliminated the gcc_version, bindir, and pkgconfigdir
> additions, and added the FULL_DRIVER_NAME variable and symlink, to
> avoid the need to install when running the jit testsuite.

> --- a/gcc/Makefile.in
> +++ b/gcc/Makefile.in
> @@ -1504,6 +1509,9 @@ BACKEND = libbackend.a main.o @TREEBROWSER@ 
> libcommon-target.a libcommon.a \
>  # front-end checking.
>  TREECHECKING = @TREECHECKING@
>  
> +# The full name of the driver on installation
> +FULL_DRIVER_NAME=$(target_noncanonical)-gcc-$(version)$(exeext)

May I suggest to remove $(exeext) here...

> @@ -1511,7 +1519,7 @@ MOSTLYCLEANFILES = insn-flags.h insn-config.h 
> insn-codes.h \
>   tm-preds.h tm-constrs.h checksum-options gimple-match.c generic-match.c \
>   tree-check.h min-insn-modes.c insn-modes.c insn-modes.h \
>   genrtl.h gt-*.h gtype-*.h gtype-desc.c gtyp-input.list \
> - xgcc$(exeext) cpp$(exeext) \
> + xgcc$(exeext) cpp$(exeext) $(FULL_DRIVER_NAME) \

..., and add it here...

> +# This symlink makes the full installation name of the driver be available
> +# from within the *build* directory, for use when running the JIT library
> +# from there (e.g. when running its testsuite).
> +$(FULL_DRIVER_NAME): ./xgcc
> +     $(LN) -s $< $@

..., and here...

> @@ -3280,9 +3294,9 @@ install-driver: installdirs xgcc$(exeext)
>       -rm -f $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
>       -$(INSTALL_PROGRAM) xgcc$(exeext) 
> $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
>       -if [ "$(GCC_INSTALL_NAME)" != "$(target_noncanonical)-gcc-$(version)" 
> ]; then \
> -       rm -f 
> $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version)$(exeext); \
> +       rm -f $(DESTDIR)$(bindir)/$(FULL_DRIVER_NAME); \
>         ( cd $(DESTDIR)$(bindir) && \
> -         $(LN) $(GCC_INSTALL_NAME)$(exeext) 
> $(target_noncanonical)-gcc-$(version)$(exeext) ); \
> +         $(LN) $(GCC_INSTALL_NAME)$(exeext) $(FULL_DRIVER_NAME) ); \

..., and here (also obviously also everywhere else where it is being
used, if applicable), and then also use $(FULL_DRIVER_NAME) in the if
statement just prior, comparing $(GCC_INSTALL_NAME) to what used to be
$(FULL_DRIVER_NAME) -- just without $(exeext)?  Alternatively, add
$(exeext) to $(GCC_INSTALL_NAME) in the if statement, but I think
generally variables such as $(FULL_DRIVER_NAME) are set up without
$(exeext).

That said, and I'll be quick to note that I have not yet looked what
you're using this for, don't you need to pass -B and similar flags to
xgcc when invoking it from the build directory?  Or is this not relevant
for your use case?  (I just stumbled over this, because we have a similar
case with "un-installed" offloading/accelerator xgcc builds that are to
be used for build-tree testing.


Another thing, just curious: why did you merge all the ChangeLog.jit
files into trunk?  I see that there are a few ChangeLog.* files from
development branch merges, but as this is not generally done, I wonder
when/why it is sometimes being done this way?


Grüße,
 Thomas

Attachment: signature.asc
Description: PGP signature

Reply via email to