1 |
commit: d6c59e8252caed2b0b382a5ea81db6988ebe585c |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Aug 18 15:40:53 2018 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Aug 18 15:40:53 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/crossdev.git/commit/?id=d6c59e82 |
7 |
|
8 |
crossdev: default to USE=-pie for bare-metal mips targets |
9 |
|
10 |
When built with pie-by-default compiling gcc fails as: |
11 |
cc1: error: position-independent code requires ‘-mabicalls’ |
12 |
|
13 |
Tested as: |
14 |
USE=-pie crossdev -t mipsel-elf |
15 |
|
16 |
Reported-by: rhn |
17 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
18 |
|
19 |
crossdev | 8 ++++++++ |
20 |
1 file changed, 8 insertions(+) |
21 |
|
22 |
diff --git a/crossdev b/crossdev |
23 |
index 4ee7076..81bd50d 100755 |
24 |
--- a/crossdev |
25 |
+++ b/crossdev |
26 |
@@ -397,6 +397,14 @@ parse_target() { |
27 |
# [2.] mingw32 startup code is broken: bug #644930 |
28 |
# at least on i686-w64-mingw32 and x86_64-w64-mingw32 |
29 |
mingw*|*-mingw*) pie_support=no;; |
30 |
+ # Some bare-metal targets don't work with pie as-is |
31 |
+ *-elf|*-eabi) |
32 |
+ case ${CTARGET} in |
33 |
+ # mips can't generate freestanding PIC: |
34 |
+ # cc1: error: position-independent code requires ‘-mabicalls’ |
35 |
+ mips*) pie_support=no;; |
36 |
+ esac |
37 |
+ ;; |
38 |
esac |
39 |
if [[ $pie_support = "no" ]]; then |
40 |
# pie is >=gcc-6, nopie is <gcc-6 |