From be07ff19cbeae0c18a8a1604f07a682e1cfbfc26 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sun, 22 Jul 2012 20:24:18 +0200 Subject: elftosb: remove version number of patch filenames Signed-off-by: Thomas Petazzoni --- package/elftosb/elftosb-fixes-includes.patch | 19 +++++ package/elftosb/elftosb-force-cxx-compiler.patch | 98 ++++++++++++++++++++++ .../elftosb/elftosb10.12.01-fixes_includes.patch | 19 ----- .../elftosb10.12.01-force_cxx_compiler.patch | 98 ---------------------- 4 files changed, 117 insertions(+), 117 deletions(-) create mode 100644 package/elftosb/elftosb-fixes-includes.patch create mode 100644 package/elftosb/elftosb-force-cxx-compiler.patch delete mode 100644 package/elftosb/elftosb10.12.01-fixes_includes.patch delete mode 100644 package/elftosb/elftosb10.12.01-force_cxx_compiler.patch (limited to 'package/elftosb') diff --git a/package/elftosb/elftosb-fixes-includes.patch b/package/elftosb/elftosb-fixes-includes.patch new file mode 100644 index 000000000..eaf8ebad9 --- /dev/null +++ b/package/elftosb/elftosb-fixes-includes.patch @@ -0,0 +1,19 @@ +This patch uses system include files instead of a hard coded system path to fixe +potential compilation failure on systems that do not populate system header +files in /usr/include/.. + +Signed-off-by: Eric Jarrige +--- +Index: host-elftosb-10.12.01/common/stdafx.h +=================================================================== +--- host-elftosb-10.12.01.orig/common/stdafx.h 2012-01-30 12:43:35.000000000 +0100 ++++ host-elftosb-10.12.01/common/stdafx.h 2012-01-30 12:43:54.000000000 +0100 +@@ -27,7 +27,7 @@ + // For Linux systems only, types.h only defines the signed + // integer types. This is not professional code. + // Update: They are defined in the header files in the more recent version of redhat enterprise gcc. +-#include "/usr/include/sys/types.h" ++#include + #include + //typedef unsigned long uint32_t; + //typedef unsigned short uint16_t; diff --git a/package/elftosb/elftosb-force-cxx-compiler.patch b/package/elftosb/elftosb-force-cxx-compiler.patch new file mode 100644 index 000000000..14df0dbe4 --- /dev/null +++ b/package/elftosb/elftosb-force-cxx-compiler.patch @@ -0,0 +1,98 @@ +Subject: [PATCH 1/1] elftosb: force host C++ compiler + +Because Freescale provides *.cpp sources and elftosb links again libstdc++, +force to use the host c++ compiler. + +This patch avoids the following error occurs: + +gcc AESKey.o Blob.o crc.o DataSource.o DataTarget.o ELFSourceFile.o EncoreBootImage.o EvalContext.o GHSSecInfo.o GlobMatcher.o HexValues.o Logging.o Operation.o OptionDictionary.o options.o OutputSection.o Random.o RijndaelCBCMAC.o rijndael.o SHA1.o SourceFile.o SRecordSourceFile.o stdafx.o StELFFile.o StExecutableImage.o StSRecordFile.o Value.o Version.o format_string.o ExcludesListMatcher.o SearchPath.o DataSourceImager.o IVTDataSource.o BootImageGenerator.o ConversionController.o ElftosbAST.o elftosb.o elftosb_lexer.o ElftosbLexer.o elftosb_parser.tab.o EncoreBootImageGenerator.o -lstdc++ -o elftosb +/usr/bin/ld: ElftosbAST.o: undefined reference to symbol 'powf@@GLIBC_2.2.5' +/usr/bin/ld: note: 'powf@@GLIBC_2.2.5' is defined in DSO /lib64/libm.so.6 so try adding it to the linker command line +/lib64/libm.so.6: could not read symbols: Invalid operation +collect2: error: ld returned 1 exit status + +When compiling with gcc and linking against libstdc++, ld uses libc instead of +libstdc++. +However, libc does not provide all functions libstdc++ does. +Indeed, maths functions are provided by libm, not libc. +Thus, elftosb should either: +- use gcc and link against libc and libm; +- or use g++ and link against libstdc++. + +Because elftosb is written in C++, this patch implement the sencond option, using +g++ and linking against libstdc++. + +Signed-off-by: Samuel Martin + +--- +Index: host-elftosb-10.12.01/makefile.rules +=================================================================== +--- host-elftosb-10.12.01.orig/makefile.rules 2012-06-09 21:12:23.557526100 +0200 ++++ host-elftosb-10.12.01/makefile.rules 2012-06-09 21:15:21.659894571 +0200 +@@ -15,6 +15,8 @@ + # UNAMES is going to be set to either "Linux" or "CYGWIN_NT-5.1" + UNAMES = $(shell uname -s) + ++CXX ?= g++ ++ + #******************************************************************************* + # Directories + +@@ -37,9 +39,9 @@ + #******************************************************************************* + # Build flags +-# gcc Compiler flags ++# Compiler flags + # -g : Produce debugging information. + +-CFLAGS = -g $(INC_PATH) -D${UNAMES} ++CXXFLAGS = -g $(INC_PATH) -D${UNAMES} + + #******************************************************************************* + # File lists +@@ -137,13 +139,13 @@ clean: + ${EXEC_FILE_ELFTOSB2} ${EXEC_FILE_SBTOOL} ${EXEC_FILE_KEYGEN} + + elftosb: ${OBJ_FILES_ELFTOSB2} +- gcc ${OBJ_FILES_ELFTOSB2} ${LIBS} -o ${EXEC_FILE_ELFTOSB2} ++ $(CXX) ${OBJ_FILES_ELFTOSB2} ${LIBS} -o ${EXEC_FILE_ELFTOSB2} + + sbtool: ${OBJ_FILES_SBTOOL} +- gcc ${OBJ_FILES_SBTOOL} ${LIBS} -o ${EXEC_FILE_SBTOOL} ++ $(CXX) ${OBJ_FILES_SBTOOL} ${LIBS} -o ${EXEC_FILE_SBTOOL} + + keygen: ${OBJ_FILES_KEYGEN} +- gcc ${OBJ_FILES_KEYGEN} ${LIBS} -o ${EXEC_FILE_KEYGEN} ++ $(CXX) ${OBJ_FILES_KEYGEN} ${LIBS} -o ${EXEC_FILE_KEYGEN} + + + #ifeq ("${UNAMES}", "Linux") +@@ -153,10 +155,10 @@ keygen: ${OBJ_FILES_KEYGEN} + .SUFFIXES : .c .cpp + + .c.o : +- gcc ${CFLAGS} -c $< ++ $(CC) ${CXXFLAGS} -c $< + + .cpp.o : +- gcc ${CFLAGS} -c $< ++ $(CXX) ${CXXFLAGS} -c $< + + #endif + +@@ -165,13 +167,13 @@ keygen: ${OBJ_FILES_KEYGEN} + + %.d: %.c + @set -e; \ +- $(CC) -MM $(CFLAGS) $< | \ ++ $(CC) -MM $(CXXFLAGS) $< | \ + sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \ + [ -s $@ ] || rm -f $@ + + %.d: %.cpp + @set -e; \ +- $(CC) -MM $(CFLAGS) $< | \ ++ $(CXX) -MM $(CXXFLAGS) $< | \ + sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \ + [ -s $@ ] || rm -f $@ + diff --git a/package/elftosb/elftosb10.12.01-fixes_includes.patch b/package/elftosb/elftosb10.12.01-fixes_includes.patch deleted file mode 100644 index eaf8ebad9..000000000 --- a/package/elftosb/elftosb10.12.01-fixes_includes.patch +++ /dev/null @@ -1,19 +0,0 @@ -This patch uses system include files instead of a hard coded system path to fixe -potential compilation failure on systems that do not populate system header -files in /usr/include/.. - -Signed-off-by: Eric Jarrige ---- -Index: host-elftosb-10.12.01/common/stdafx.h -=================================================================== ---- host-elftosb-10.12.01.orig/common/stdafx.h 2012-01-30 12:43:35.000000000 +0100 -+++ host-elftosb-10.12.01/common/stdafx.h 2012-01-30 12:43:54.000000000 +0100 -@@ -27,7 +27,7 @@ - // For Linux systems only, types.h only defines the signed - // integer types. This is not professional code. - // Update: They are defined in the header files in the more recent version of redhat enterprise gcc. --#include "/usr/include/sys/types.h" -+#include - #include - //typedef unsigned long uint32_t; - //typedef unsigned short uint16_t; diff --git a/package/elftosb/elftosb10.12.01-force_cxx_compiler.patch b/package/elftosb/elftosb10.12.01-force_cxx_compiler.patch deleted file mode 100644 index 14df0dbe4..000000000 --- a/package/elftosb/elftosb10.12.01-force_cxx_compiler.patch +++ /dev/null @@ -1,98 +0,0 @@ -Subject: [PATCH 1/1] elftosb: force host C++ compiler - -Because Freescale provides *.cpp sources and elftosb links again libstdc++, -force to use the host c++ compiler. - -This patch avoids the following error occurs: - -gcc AESKey.o Blob.o crc.o DataSource.o DataTarget.o ELFSourceFile.o EncoreBootImage.o EvalContext.o GHSSecInfo.o GlobMatcher.o HexValues.o Logging.o Operation.o OptionDictionary.o options.o OutputSection.o Random.o RijndaelCBCMAC.o rijndael.o SHA1.o SourceFile.o SRecordSourceFile.o stdafx.o StELFFile.o StExecutableImage.o StSRecordFile.o Value.o Version.o format_string.o ExcludesListMatcher.o SearchPath.o DataSourceImager.o IVTDataSource.o BootImageGenerator.o ConversionController.o ElftosbAST.o elftosb.o elftosb_lexer.o ElftosbLexer.o elftosb_parser.tab.o EncoreBootImageGenerator.o -lstdc++ -o elftosb -/usr/bin/ld: ElftosbAST.o: undefined reference to symbol 'powf@@GLIBC_2.2.5' -/usr/bin/ld: note: 'powf@@GLIBC_2.2.5' is defined in DSO /lib64/libm.so.6 so try adding it to the linker command line -/lib64/libm.so.6: could not read symbols: Invalid operation -collect2: error: ld returned 1 exit status - -When compiling with gcc and linking against libstdc++, ld uses libc instead of -libstdc++. -However, libc does not provide all functions libstdc++ does. -Indeed, maths functions are provided by libm, not libc. -Thus, elftosb should either: -- use gcc and link against libc and libm; -- or use g++ and link against libstdc++. - -Because elftosb is written in C++, this patch implement the sencond option, using -g++ and linking against libstdc++. - -Signed-off-by: Samuel Martin - ---- -Index: host-elftosb-10.12.01/makefile.rules -=================================================================== ---- host-elftosb-10.12.01.orig/makefile.rules 2012-06-09 21:12:23.557526100 +0200 -+++ host-elftosb-10.12.01/makefile.rules 2012-06-09 21:15:21.659894571 +0200 -@@ -15,6 +15,8 @@ - # UNAMES is going to be set to either "Linux" or "CYGWIN_NT-5.1" - UNAMES = $(shell uname -s) - -+CXX ?= g++ -+ - #******************************************************************************* - # Directories - -@@ -37,9 +39,9 @@ - #******************************************************************************* - # Build flags --# gcc Compiler flags -+# Compiler flags - # -g : Produce debugging information. - --CFLAGS = -g $(INC_PATH) -D${UNAMES} -+CXXFLAGS = -g $(INC_PATH) -D${UNAMES} - - #******************************************************************************* - # File lists -@@ -137,13 +139,13 @@ clean: - ${EXEC_FILE_ELFTOSB2} ${EXEC_FILE_SBTOOL} ${EXEC_FILE_KEYGEN} - - elftosb: ${OBJ_FILES_ELFTOSB2} -- gcc ${OBJ_FILES_ELFTOSB2} ${LIBS} -o ${EXEC_FILE_ELFTOSB2} -+ $(CXX) ${OBJ_FILES_ELFTOSB2} ${LIBS} -o ${EXEC_FILE_ELFTOSB2} - - sbtool: ${OBJ_FILES_SBTOOL} -- gcc ${OBJ_FILES_SBTOOL} ${LIBS} -o ${EXEC_FILE_SBTOOL} -+ $(CXX) ${OBJ_FILES_SBTOOL} ${LIBS} -o ${EXEC_FILE_SBTOOL} - - keygen: ${OBJ_FILES_KEYGEN} -- gcc ${OBJ_FILES_KEYGEN} ${LIBS} -o ${EXEC_FILE_KEYGEN} -+ $(CXX) ${OBJ_FILES_KEYGEN} ${LIBS} -o ${EXEC_FILE_KEYGEN} - - - #ifeq ("${UNAMES}", "Linux") -@@ -153,10 +155,10 @@ keygen: ${OBJ_FILES_KEYGEN} - .SUFFIXES : .c .cpp - - .c.o : -- gcc ${CFLAGS} -c $< -+ $(CC) ${CXXFLAGS} -c $< - - .cpp.o : -- gcc ${CFLAGS} -c $< -+ $(CXX) ${CXXFLAGS} -c $< - - #endif - -@@ -165,13 +167,13 @@ keygen: ${OBJ_FILES_KEYGEN} - - %.d: %.c - @set -e; \ -- $(CC) -MM $(CFLAGS) $< | \ -+ $(CC) -MM $(CXXFLAGS) $< | \ - sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \ - [ -s $@ ] || rm -f $@ - - %.d: %.cpp - @set -e; \ -- $(CC) -MM $(CFLAGS) $< | \ -+ $(CXX) -MM $(CXXFLAGS) $< | \ - sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \ - [ -s $@ ] || rm -f $@ - -- cgit v1.2.3