Patchwork [take2] Make LTO plugin object-file-format- and host- independent.

login
register
mail settings
Submitter Richard Sandiford
Date Oct. 12, 2010, 1:36 p.m.
Message ID <g4y6a35y8x.fsf@richards-desktop.stglab.manchester.uk.ibm.com>
Download mbox | patch
Permalink /patch/67574/
State New
Headers show

Comments

Richard Sandiford - Oct. 12, 2010, 1:36 p.m.
Hi Dave,

Sorry if this is a dup, but...

Dave Korn <dave.korn.cygwin@gmail.com> writes:
> 	* configure.ac: Source config.gcc to determine lto_binary_reader.

...I've been experimenting with some ARM builds and noticed that this
doesn't quite work with options like --with-cpu.  The problem is that
config.gcc validates the option against ${srcdir}/config/arm/arm-cores.def
and exits the configure script if it can't find the file.

It's a little (read "very") hackish, but how about the following?
Tested on arm-linux-gnueabi using --with-cpu=cortex-a8.  Alternatively,
we could add a new m4 macro for setting lto_binary_reader.

Richard


lto-plugin/
	* configure.ac: Set srcdir appropriately when sourcing config.gcc.
	* configure: Regenerate.
Dave Korn - Oct. 12, 2010, 6:46 p.m.
On 12/10/2010 14:36, Richard Sandiford wrote:
> Hi Dave,
> 
> Sorry if this is a dup, but...
> 
> Dave Korn <dave.korn.cygwin@gmail.com> writes:
>> 	* configure.ac: Source config.gcc to determine lto_binary_reader.
> 
> ...I've been experimenting with some ARM builds and noticed that this
> doesn't quite work with options like --with-cpu.  The problem is that
> config.gcc validates the option against ${srcdir}/config/arm/arm-cores.def
> and exits the configure script if it can't find the file.

  Sorry, I guess I should have worried more about running that script outside
its normal context.  Hmm, could be a similar problem on m68k as well.

> It's a little (read "very") hackish, but how about the following?

  I guess it's no more hackish than reaching into a parallel srcdir for a
configure sub-script anyway :-(

> Tested on arm-linux-gnueabi using --with-cpu=cortex-a8.  Alternatively,
> we could add a new m4 macro for setting lto_binary_reader.

  I had a look through config.gcc for explict 'exit' statements, and 'awk' and
'grep' references, and I /think/ $srcdir is all we'll need.  It's as you say
not elegant but I think it's necessary.  Stick it on as a bandaid for now, and
I'll see if I can think of something better in the near future.

    cheers,
      DaveK

Patch

Index: lto-plugin/configure.ac
===================================================================
--- lto-plugin/configure.ac	2010-10-11 14:09:57.000000000 +0100
+++ lto-plugin/configure.ac	2010-10-12 14:13:21.000000000 +0100
@@ -10,7 +10,10 @@  AC_ARG_VAR(LIBELFLIBS,[How to link libel
 AC_ARG_VAR(LIBELFINC,[How to find libelf include files])
 AM_PROG_LIBTOOL
 AC_SUBST(target_noncanonical)
-. ${srcdir}/../gcc/config.gcc
+old_srcdir=${srcdir}
+srcdir=${srcdir}/../gcc
+. ${srcdir}/config.gcc
+srcdir=${old_srcdir}
 case ${lto_binary_reader} in
   *coff*) LTO_FORMAT=coff ;;
   *elf*)  LTO_FORMAT=elf ;;