This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

bootstrap failure, genrecog, strstr, build and host



Currently, bootstrapping gcc fails on build platforms that lacks `strstr',
with the following error :

cc  -DIN_GCC    -g  -DHAVE_CONFIG_H  -o genrecog \
 genrecog.o rtl.o bitmap.o ggc-none.o print-rtl.o errors.o ` case "obstack.o" in
 ?*) echo obstack.o ;; esac ` ` case "alloca.o" in ?*) echo alloca.o ;; esac ` `
 case "" in ?*) echo  ;; esac `  ` case "" in ?*) echo  ;; esac ` ` case "" in ?
*) echo  ;; esac `
genrecog.o: In function `validate_pattern':
genrecog.c:556: undefined reference to `strstr'

Of course, I would like to see that fixed, and submitted a simple patch
to add libiberty to the link list for genrecog.

It was rejected because libiberty is currently not available for
build-programs, but only for host-programs.

I have no real interest in building gcc when host != build, but I thought
that I could have a look to try to fix the above problem.

(The following assumes that `build' is the machine we are now running on,
`host' is the machine we want the compiler to run on and
`target' is the machine we want our produced compiler to compile code for.
If I am wrong about that don't read further)

Trying to look at the problem, I noticed some inconsistencies :
	- configure uses the result of `config.guess' as `host' while I
	  would expect to see it use it as `build'
	  The effect is now, I think, that configure --host=HOST --target=TARGET
	  won't produce a compiler running on HOST targetting TARGET,
	  but will fail using a mix of BUILD-tested and HOST-provided
	  configuration and trying to compile a build-hosted compiler
	  targetting TARGET. 
	- genrecog and other build programs include `hconfig.h' and
	  `auto-host.h', while I would expect them to use `build-config.h'
	  and `auto-build.h'.
	- the link list used by genrecog contains HOST_RTL, HOST_PRINT,
	  HOST_ERRORS and HOST_LIBS.  Should those macros not be called
	  BUILD_RTL, BUILD_PRINT, BUILD_ERRORS and BUILD_LIBS ?
	- in the case of build != host, what are the names of the
	  different involved compilers in gcc/Makefile or Makefile.

I think that using the right names in the right places would help people
understand what's going on and fix the problems.

In the mean time, when build == host, we could
    - simply link libiberty/libiberty.a to, let say, buildiberty/libiberty.a,
      and add ../buildiberty/libiberty.a to HOST_LIBS,
    - or define BUILDIBERTY_LIB as ../libiberty/libiberty.a and add
      BUILDIBERTY_LIB to HOST_LIBS.

Philippe


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]