From 1ef46438da505e9fa13ad7331d11262a9f726de5 Mon Sep 17 00:00:00 2001 From: Patrick Williams Date: Tue, 1 Jul 2014 21:35:40 -0500 Subject: Build changes to support buildroot Change-Id: I8f2bef01886d69d275824054faac4be34b9cac6b Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/11943 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III --- src/build/linker/linker.C | 5 ++++- src/build/linker/makefile | 17 ++++++++++++++--- src/build/mkrules/beam.env.mk | 6 ++++-- src/build/mkrules/cc.env.mk | 10 +++++++--- src/build/mkrules/cflags.env.mk | 7 +++++-- src/build/trace/makefile | 17 ++++++++++++++--- src/include/assert.h | 7 +++++-- src/kernel.ld | 5 ++++- src/module.ld | 5 ++++- src/usr/diag/prdf/framework/rule/makefile | 6 ++++-- src/usr/hwpf/makefile | 2 +- 11 files changed, 66 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/build/linker/linker.C b/src/build/linker/linker.C index 650b1d4f6..f79071fe2 100644 --- a/src/build/linker/linker.C +++ b/src/build/linker/linker.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ +/* Contributors Listed Below - COPYRIGHT 2011,2014 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -45,6 +47,7 @@ #include #include #include +#include #define LINKER_C #include "../../include/sys/vfs.h" diff --git a/src/build/linker/makefile b/src/build/linker/makefile index ab8b26e9f..b9d4c749a 100644 --- a/src/build/linker/makefile +++ b/src/build/linker/makefile @@ -5,7 +5,9 @@ # # OpenPOWER HostBoot Project # -# COPYRIGHT International Business Machines Corp. 2011,2014 +# Contributors Listed Below - COPYRIGHT 2011,2014 +# [+] International Business Machines Corp. +# # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,6 +24,14 @@ # IBM_PROLOG_END_TAG ROOTPATH = ../../.. +ifdef HOST_BINUTILS_DIR +BFD_CFLAGS = -I$(HOST_BINUTILS_DIR)/bfd/ -I$(HOST_BINUTILS_DIR)/include/ +BFD_LDFLAGS = $(HOST_BINUTILS_DIR)/bfd/libbfd.a \ + $(HOST_BINUTILS_DIR)/libiberty/libiberty.a -lz +else +BFD_LDFLAGS = -lbfd -liberty -lz +endif + CODE_PASS_POST += linker gensyms genlist CLEAN_TARGETS += linker linker.o gensyms gensyms.o genlist genlist.o @@ -29,9 +39,10 @@ include $(ROOTPATH)/config.mk linker: linker.C $(C2) " CXX $(notdir $<)" - $(C1)$(CCACHE) $(HOST_PREFIX)g++ -O3 -g linker.C -o linker.o -c + $(C1)$(CCACHE) $(HOST_PREFIX)g++ -O3 -g linker.C -o linker.o -c \ + $(BFD_CFLAGS) $(C1)$(CCACHE) $(HOST_PREFIX)g++ -O3 -g linker.o -o linker \ - -lbfd -liberty -lz + $(BFD_LDFLAGS) $(C1)rm linker.o gensyms: gensyms.C diff --git a/src/build/mkrules/beam.env.mk b/src/build/mkrules/beam.env.mk index 64158b372..6c0377c2f 100644 --- a/src/build/mkrules/beam.env.mk +++ b/src/build/mkrules/beam.env.mk @@ -5,7 +5,9 @@ # # OpenPOWER HostBoot Project # -# COPYRIGHT International Business Machines Corp. 2013,2014 +# Contributors Listed Below - COPYRIGHT 2013,2014 +# [+] International Business Machines Corp. +# # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,7 +30,7 @@ AFSCELL := austin BEAMVER = beam-3.6.1 BEAMPATH = /afs/${AFSCELL}/projects/esw/beam/$(BEAMVER) -BEAMCMD = $(HOST_PREFIX)jail $(BEAMPATH)/bin/beam_compile +BEAMCMD = $(JAILCMD) $(BEAMPATH)/bin/beam_compile ifdef MODULE BEAMDIR = $(ROOTPATH)/obj/beam/$(MODULE) diff --git a/src/build/mkrules/cc.env.mk b/src/build/mkrules/cc.env.mk index fdcaa08b7..68dde9779 100644 --- a/src/build/mkrules/cc.env.mk +++ b/src/build/mkrules/cc.env.mk @@ -5,7 +5,9 @@ # # OpenPOWER HostBoot Project # -# COPYRIGHT International Business Machines Corp. 2013,2014 +# Contributors Listed Below - COPYRIGHT 2013,2014 +# [+] International Business Machines Corp. +# # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,6 +30,8 @@ CROSS_PREFIX ?= powerpc64-unknown-linux-gnu- HOST_PREFIX ?= x86_64-pc-linux-gnu- +JAILCMD ?= $(HOST_PREFIX)jail + CC_RAW = $(CROSS_PREFIX)gcc -std=c99 CXX_RAW = $(CROSS_PREFIX)g++ CC = $(CCACHE) $(CC_RAW) @@ -38,9 +42,9 @@ OBJDUMP = $(CROSS_PREFIX)objdump GCOV = $(CROSS_PREFIX)gcov CUSTOM_LINKER_EXE = $(ROOTPATH)/src/build/linker/linker -CUSTOM_LINKER = $(HOST_PREFIX)jail $(CUSTOM_LINKER_EXE) +CUSTOM_LINKER = $(JAILCMD) $(CUSTOM_LINKER_EXE) TRACE_HASHER_EXE = $(ROOTPATH)/src/build/trace/tracehash #TRACE_HASHER = $(TRACE_HASHER_EXE) -TRACE_HASHER = $(HOST_PREFIX)jail $(TRACE_HASHER_EXE) +TRACE_HASHER = $(JAILCMD) $(TRACE_HASHER_EXE) diff --git a/src/build/mkrules/cflags.env.mk b/src/build/mkrules/cflags.env.mk index 0af33242d..a9589aa60 100644 --- a/src/build/mkrules/cflags.env.mk +++ b/src/build/mkrules/cflags.env.mk @@ -5,7 +5,9 @@ # # OpenPOWER HostBoot Project # -# COPYRIGHT International Business Machines Corp. 2013,2014 +# Contributors Listed Below - COPYRIGHT 2013,2014 +# [+] International Business Machines Corp. +# # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -37,7 +39,8 @@ CFLAGS += $(COMMONFLAGS) -mcpu=power7 -nostdinc -g -mno-vsx -mno-altivec\ -Wall -Werror -mtraceback=no -pipe \ -ffunction-sections -fdata-sections ASMFLAGS += $(COMMONFLAGS) -mcpu=power7 -CXXFLAGS += $(CFLAGS) -nostdinc++ -fno-rtti -fno-exceptions -Wall +CXXFLAGS += $(CFLAGS) -nostdinc++ -fno-rtti -fno-exceptions -Wall \ + -fuse-cxa-atexit LDFLAGS += --nostdlib --sort-common $(COMMONFLAGS) INCFLAGS = $(addprefix -I, $(INCDIR) ) diff --git a/src/build/trace/makefile b/src/build/trace/makefile index b30529c10..e80ed8a68 100644 --- a/src/build/trace/makefile +++ b/src/build/trace/makefile @@ -5,7 +5,9 @@ # # OpenPOWER HostBoot Project # -# COPYRIGHT International Business Machines Corp. 2013,2014 +# Contributors Listed Below - COPYRIGHT 2013,2014 +# [+] International Business Machines Corp. +# # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,10 +27,19 @@ ROOTPATH = ../../.. GEN_PASS_BODY += tracehash CLEAN_TARGETS += tracehash tracehash.o +ifdef HOST_BINUTILS_DIR +BFD_CFLAGS = -I$(HOST_BINUTILS_DIR)/bfd/ -I$(HOST_BINUTILS_DIR)/include/ +BFD_LDFLAGS = $(HOST_BINUTILS_DIR)/bfd/libbfd.a \ + $(HOST_BINUTILS_DIR)/libiberty/libiberty.a -lz +else +BFD_LDFLAGS = -lbfd +endif + include $(ROOTPATH)/config.mk tracehash: tracehash.c $(C2) " CC $(notdir $<)" - $(C1)$(CCACHE) $(HOST_PREFIX)gcc -std=c99 -O3 -g -c $< -o $@.o - $(C1)$(CCACHE) $(HOST_PREFIX)gcc -O3 -g $@.o -o $@ -lbfd + $(C1)$(CCACHE) $(HOST_PREFIX)gcc -std=c99 -O3 -g -c $< -o $@.o \ + $(BFD_CFLAGS) + $(C1)$(CCACHE) $(HOST_PREFIX)gcc -O3 -g $@.o -o $@ $(BFD_LDFLAGS) $(C1)rm $@.o diff --git a/src/include/assert.h b/src/include/assert.h index 86a943e49..3ef19ba1a 100644 --- a/src/include/assert.h +++ b/src/include/assert.h @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2011,2014 */ +/* Contributors Listed Below - COPYRIGHT 2011,2014 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -197,7 +199,8 @@ void __assert(AssertBehavior i_assertb, int i_line); * typedef char CHECKSIZEVAR[(EXPECTED_SIZE == sizeof(DATA)) -1] * */ -#define CPPASSERT(exp) typedef char compile_time_assert_failed[2*((exp)?1:0)-1] +//#define CPPASSERT(exp) typedef char compile_time_assert_failed[2*((exp)?1:0)-1] +#define CPPASSERT(exp) //@TODO #ifdef __cplusplus diff --git a/src/kernel.ld b/src/kernel.ld index 56c07d026..e1fddb7b7 100644 --- a/src/kernel.ld +++ b/src/kernel.ld @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2010,2014 */ +/* Contributors Listed Below - COPYRIGHT 2010,2014 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -43,6 +45,7 @@ SECTIONS ctor_end_address = .; *(.rodata) *(.rodata.*) + . = ALIGN(8); toc_load_address = .; *(.toc) *(.opd) diff --git a/src/module.ld b/src/module.ld index 36d0e7f6a..2716f1a92 100644 --- a/src/module.ld +++ b/src/module.ld @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2010,2014 */ +/* Contributors Listed Below - COPYRIGHT 2010,2014 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -36,6 +38,7 @@ SECTIONS ctor_end_address = .; *(.rodata) *(.rodata.*) + . = ALIGN(8); *(.toc) *(.opd) *(.got) diff --git a/src/usr/diag/prdf/framework/rule/makefile b/src/usr/diag/prdf/framework/rule/makefile index f36940746..628ff19ca 100755 --- a/src/usr/diag/prdf/framework/rule/makefile +++ b/src/usr/diag/prdf/framework/rule/makefile @@ -5,7 +5,9 @@ # # OpenPOWER HostBoot Project # -# COPYRIGHT International Business Machines Corp. 2012,2014 +# Contributors Listed Below - COPYRIGHT 2012,2014 +# [+] International Business Machines Corp. +# # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -204,7 +206,7 @@ ${OBJ_RULE_DIR}/%.prf.err.C \ ${OBJ_RULE_DIR}/%.prf.reg.C : %.rule ${PRDR_CMP_PATH} ${PRD_OUT_MAKE} $(C1)cat $< | ${SRC_USR_DIR}/common/framework/rule/prdrpp \ - ${PRDRPP_SEARCHDIRS} | $(HOST_PREFIX)jail ${PRDR_CMP_PATH} $@ + ${PRDRPP_SEARCHDIRS} | $(JAILCMD) ${PRDR_CMP_PATH} $@ # Copy all .prf files from ${OBJ_RULE_DIR} to ${IMGDIR} ${PRF_IMG_PATHS}: ${IMGDIR}/% : ${OBJ_RULE_DIR}/% diff --git a/src/usr/hwpf/makefile b/src/usr/hwpf/makefile index 9359588ca..432ff041c 100644 --- a/src/usr/hwpf/makefile +++ b/src/usr/hwpf/makefile @@ -442,7 +442,7 @@ $${GENDIR}/$(basename $(notdir $1)).if :\ $${GENDIR}/$${IF_CMP_COMPILER_TARGET} \ $${GENDIR}/$${FAPI_ATTR_ID_TARGET} \ $${HWP_IF_DEFINE_DIR} $1 - $$(HOST_PREFIX)jail \ + $$(JAILCMD) \ $$< -init $1 -outdir $$(dir $$@) \ -attr $${GENDIR}/$${FAPI_ATTR_ID_TARGET} \ -I $${HWP_IF_DEFINE_DIR} -- cgit v1.2.1