• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/elftosb/0002-force-cxx-compiler.patch
Peter KorsgaardPeter Korsgaard committed 298cd8eaa2103 Feb 2015
Raw file
Source viewDiff to previous
 
1
Subject: [PATCH 1/1] elftosb: force host C++ compiler
2
​
3
Because Freescale provides *.cpp sources and elftosb links again libstdc++,
4
force to use the host c++ compiler.
5
​
6
This patch avoids the following error occurs:
7
​
8
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
9
/usr/bin/ld: ElftosbAST.o: undefined reference to symbol 'powf@@GLIBC_2.2.5'
10
/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
11
/lib64/libm.so.6: could not read symbols: Invalid operation
12
collect2: error: ld returned 1 exit status
13
​
14
When compiling with gcc and linking against libstdc++, ld uses libc instead of
15
libstdc++.
16
However, libc does not provide all functions libstdc++ does.
17
Indeed, maths functions are provided by libm, not libc.
18
Thus, elftosb should either:
19
- use gcc and link against libc and libm;
20
- or use g++ and link against libstdc++.
21
​
22
Because elftosb is written in C++, this patch implement the sencond option, using
23
g++ and linking against libstdc++.
24
​
25
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
26
​
27
---
28
Index: host-elftosb-10.12.01/makefile.rules
29
===================================================================
30
--- host-elftosb-10.12.01.orig/makefile.rules   2012-06-09 21:12:23.557526100 +0200
31
+++ host-elftosb-10.12.01/makefile.rules    2012-06-09 21:15:21.659894571 +0200
32
@@ -15,6 +15,8 @@
33
 # UNAMES is going to be set to either "Linux" or "CYGWIN_NT-5.1"
34
 UNAMES = $(shell uname -s)
35
​
36
+CXX ?= g++
37
+
38
 #*******************************************************************************
39
 #                               Directories
40
​
41
@@ -37,9 +39,9 @@
42
 #*******************************************************************************
43
 #                               Build flags
44
-# gcc Compiler flags
45
+# Compiler flags
46
 #    -g                        : Produce debugging information.
47
​
48
-CFLAGS     = -g $(INC_PATH) -D${UNAMES}
49
+CXXFLAGS   = -g $(INC_PATH) -D${UNAMES}
50
​
51
 #*******************************************************************************
52
 #                               File lists
53
@@ -137,13 +139,13 @@ clean:
54
        ${EXEC_FILE_ELFTOSB2} ${EXEC_FILE_SBTOOL} ${EXEC_FILE_KEYGEN}
55
​
56
 elftosb: ${OBJ_FILES_ELFTOSB2}
57
-   gcc ${OBJ_FILES_ELFTOSB2} ${LIBS} -o ${EXEC_FILE_ELFTOSB2}
58
+   $(CXX) ${OBJ_FILES_ELFTOSB2} ${LIBS} -o ${EXEC_FILE_ELFTOSB2}
59
​
60
 sbtool: ${OBJ_FILES_SBTOOL}
61
-   gcc ${OBJ_FILES_SBTOOL} ${LIBS} -o ${EXEC_FILE_SBTOOL}
62
+   $(CXX) ${OBJ_FILES_SBTOOL} ${LIBS} -o ${EXEC_FILE_SBTOOL}
63
​
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.