Opened 13 months ago

Closed 6 weeks ago

#5895 closed defect (fixed)

Configure error with GCC 6.2.0 and libsnappy

Reported by: Zeranoe Owned by:
Priority: important Component: build system
Version: git-master Keywords: regression
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

When using MinGW-w64 and GCC 6.2.0 and configuring with

--enable-libsnappy

the configure process errors with relocation overflows.

There are numerous overflow errors, but the first is

libstdc++.a(cow-stdexcept.o): In function `_txnal_cow_string_C1_for_exceptions(void*, char const*, void*)':
cow-stdexcept.cc:236:(.text$_Z35_txnal_cow_string_C1_for_exceptionsPvPKcS_+0x2c): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_ITM_RU1'

This appears to be happening because of the ldflag

-Wl,--image-base,0x140000000

added on line 4769 in configure, and removing this ldflag resolves the issue for me.

This ldflag was added with commit a58c22d61260941fc651add73836882d5b112fdb

Change History (3)

comment:1 Changed 13 months ago by cehoyos

  • Keywords regression added
  • Status changed from new to open

comment:2 Changed 13 months ago by heleppkes

This LDFLAG exists for security reasons, I suggest you inquire with snappy why they don't work with it.

comment:3 Changed 6 weeks ago by Zeranoe

  • Resolution set to fixed
  • Status changed from open to closed

This was resolved by patching libstdc++-v3/config/os/mingw32-w64/os_defines.h in GCC's source.

diff -uprN a/libstdc++-v3/config/os/mingw32-w64/os_defines.h b/libstdc++-v3/config/os/mingw32-w64/os_defines.h
--- a/libstdc++-v3/config/os/mingw32-w64/os_defines.h   2017-01-01 04:07:43.000000000 -0800
+++ b/libstdc++-v3/config/os/mingw32-w64/os_defines.h   2017-05-25 18:47:52.161016148 -0700
@@ -76,6 +76,7 @@
 #ifdef __x86_64__
 #define _GLIBCXX_LLP64 1
+#define _GLIBCXX_USE_WEAK_REF 0
 #endif
 // Enable use of GetModuleHandleEx (requires Windows XP/2003) in

Further info here

Note: See TracTickets for help on using tickets.