Bug#775435: iwyu: FTBFS on mips64el

2016-10-06 Thread Daniel Knezevic
Tags: patch

Hi,

As James proposed I added -mxgot to the cxx flags for mips64el.

With attached patch I was able to build iwyu successfully for mips64el.

Thanks,
Daniel
--- debian/rules	2016-10-06 06:06:05.0 +
+++ debian/rules	2016-10-06 05:33:16.0 +
@@ -6,12 +6,18 @@
 
 TARGET_BUILD=iwyu-build
 VERSION=$(shell dpkg-parsechangelog |grep "^Version:"|sed -e "s|Version: \(.*\)|\1|")
+DEB_BUILD_ARCH?=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
+ADDITIONAL_CXX_FLAGS=""
+
+ifneq (,$(filter $(DEB_BUILD_ARCH),mips64el))
+	ADDITIONAL_CXX_FLAGS += -mxgot
+endif
 
 %:
 	dh $@ --buildsystem=cmake --builddirectory=$(TARGET_BUILD)
 
 override_dh_auto_configure:
-	dh_auto_configure -- -DLLVM_PATH=/usr/lib/llvm-3.8/
+	dh_auto_configure -- -DLLVM_PATH=/usr/lib/llvm-3.8/ -DCMAKE_CXX_FLAGS="$(ADDITIONAL_CXX_FLAGS)"
 
 override_dh_auto_build:
 	dh_auto_build



Bug#775435: iwyu: FTBFS on mips64el

2015-01-15 Thread James Cowgill
Source: iwyu
Version: 3.4-1
Severity: important

Hi,

iwyu FTBFS on mips64el with the following relocation errors:

 CMakeFiles/include-what-you-use.dir/iwyu.cc.o: In function 
 `include_what_you_use::(anonymous namespace)::IntToString(int)':
 iwyu.cc:(.text+0x50): relocation truncated to fit: R_MIPS_CALL16 against 
 `snprintf@@GLIBC_2.0'
 iwyu.cc:(.text+0x64): relocation truncated to fit: R_MIPS_CALL16 against 
 `std::allocatorchar::allocator()@@GLIBCXX_3.4'
 iwyu.cc:(.text+0x84): relocation truncated to fit: R_MIPS_CALL16 against 
 `std::basic_stringchar, std::char_traitschar, std::allocatorchar 
 ::basic_string(char const*, std::allocatorchar const)@@GLIBCXX_3.4'
 iwyu.cc:(.text+0x98): relocation truncated to fit: R_MIPS_CALL16 against 
 `std::allocatorchar::~allocator()@@GLIBCXX_3.4'
 iwyu.cc:(.text+0xb8): relocation truncated to fit: R_MIPS_CALL16 against 
 `std::allocatorchar::~allocator()@@GLIBCXX_3.4'
 iwyu.cc:(.text+0xd0): relocation truncated to fit: R_MIPS_CALL16 against 
 `_Unwind_Resume@@GCC_3.0'
 CMakeFiles/include-what-you-use.dir/iwyu.cc.o: In function `main':
 iwyu.cc:(.text+0x1a0): relocation truncated to fit: R_MIPS_CALL16 against 
 `operator new[](unsigned long)@@GLIBCXX_3.4'
 iwyu.cc:(.text+0x200): relocation truncated to fit: R_MIPS_CALL16 against 
 `operator new[](unsigned long)@@GLIBCXX_3.4'
 iwyu.cc:(.text+0x274): relocation truncated to fit: R_MIPS_CALL16 against 
 `strcmp@@GLIBC_2.0'
 iwyu.cc:(.text+0x2f0): relocation truncated to fit: R_MIPS_CALL16 against 
 `strcmp@@GLIBC_2.0'
 iwyu.cc:(.text+0x404): additional relocation overflows omitted from the output
 collect2: error: ld returned 1 exit status

The full log is available here:
http://mipsdebian.imgtec.com/debian/logs/i/iwyu/iwyu_3.4-1_mips64el-20150115-0137.build.gz

I think this happens due to a GOT overflow somewhere (the max size of
the GOT in MIPS is 64K per translation unit). It can be fixed by passing
-mxgot on mips64el, although that will incur a performance penalty.
Strangely, moving iwyu.cc to the end of the list of C files to be built
(in the add_executable call in CMakeLists.txt) also fixes this. I don't
know how reliable this will be though.

Thanks,
James


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org