Skip to content
Snippets Groups Projects
Commit acd7e7b3 authored by Tobias Burnus's avatar Tobias Burnus
Browse files

PowerPC: Fix rs6000-gen-builtins with build != host [PR102353]

This mimics what the main Makefile.in does: compile the generator
files under build (with Makefile.in's 'build/%.o' rule for compilation).
It also adds $(RUN_GEN) to optionally run it with valgrind and
the $(build_exeext) suffix.

Before, the .o files were compiled with $(COMPILE), causing link
error with $(LINKER_FOR_BUILD) for build != host.

gcc/
	PR target/102353
	* config/rs6000/t-rs6000 (build/rs6000-gen-builtins.o, build/rbtree.o):
	Added 'build/' to target, use build/%.o rule.
	(build/rs6000-gen-builtins$(build_exeext)): Add 'build/' and
	'$(build_exeext)' to target and 'build/' for the *.o files.
	(rs6000-builtins.c): Update for those changes; run rs6000-gen-builtins
	with $(RUN_GEN).
parent 371848a7
No related branches found
No related tags found
No related merge requests found
......@@ -44,15 +44,11 @@ rs6000-logue.o: $(srcdir)/config/rs6000/rs6000-logue.c
$(COMPILE) $<
$(POSTCOMPILE)
rs6000-gen-builtins.o: $(srcdir)/config/rs6000/rs6000-gen-builtins.c
$(COMPILE) $<
$(POSTCOMPILE)
rbtree.o: $(srcdir)/config/rs6000/rbtree.c
$(COMPILE) $<
$(POSTCOMPILE)
build/rs6000-gen-builtins.o: $(srcdir)/config/rs6000/rs6000-gen-builtins.c
build/rbtree.o: $(srcdir)/config/rs6000/rbtree.c
rs6000-gen-builtins: rs6000-gen-builtins.o rbtree.o
build/rs6000-gen-builtins$(build_exeext): build/rs6000-gen-builtins.o \
build/rbtree.o $(BUILD_LIBDEPS)
$(LINKER_FOR_BUILD) $(BUILD_LINKERFLAGS) $(BUILD_LDFLAGS) -o $@ \
$(filter-out $(BUILD_LIBDEPS), $^) $(BUILD_LIBS)
......@@ -62,10 +58,11 @@ rs6000-gen-builtins: rs6000-gen-builtins.o rbtree.o
# <recipe>
# For now, the header files depend on rs6000-builtins.c, which avoids
# races because the .c file is closed last in rs6000-gen-builtins.c.
rs6000-builtins.c: rs6000-gen-builtins \
rs6000-builtins.c: build/rs6000-gen-builtins$(build_exeext) \
$(srcdir)/config/rs6000/rs6000-builtin-new.def \
$(srcdir)/config/rs6000/rs6000-overload.def
./rs6000-gen-builtins $(srcdir)/config/rs6000/rs6000-builtin-new.def \
$(RUN_GEN) ./build/rs6000-gen-builtins$(build_exeext) \
$(srcdir)/config/rs6000/rs6000-builtin-new.def \
$(srcdir)/config/rs6000/rs6000-overload.def rs6000-builtins.h \
rs6000-builtins.c rs6000-vecdefines.h
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment