Opened 6 years ago

Closed 5 years ago

#12888 closed Bugs (fixed)

Linking with boost thread does not work on mingw/gcc 4.4

Reported by: anonymous Owned by: viboes
Milestone: Boost 1.65.0 Component: thread
Version: Boost 1.63.0 Severity: Problem
Keywords: Cc:

Description

boost 1.63 when used mingw32 compiling x86 target mingw32 version 4.4.0

Errors: c:/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libmingw32.a(tlssup.o):tlssup.c:(.tls+0x0): multiple definition of `_tls_used' C:\boost\mingw/Lib/libboost_thread.a(tss_pe.o):tss_pe.cpp:(.rdata$T+0x0): first defined here

modify “boost_1_63_0/libs/thread/src/win32/tss_pe.cpp”

#if defined(MINGW64)
(MINGW32_MAJOR_VERSION >3)

((MINGW32_MAJOR_VERSION==3) && (MINGW32_MINOR_VERSION>=18))

I've changed it to:

#if defined(MINGW64)
(MINGW64_VERSION_MAJOR) (MINGW32) (MINGW32_MAJOR_VERSION >3)

((MINGW32_MAJOR_VERSION==3) && (MINGW32_MINOR_VERSION>=18))

Change History (6)

in reply to:  description comment:1 by anonymous, 6 years ago

Replying to anonymous:

boost 1.63 when used mingw32 compiling x86 target

mingw32 version 4.4.0

Errors: c:/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libmingw32.a(tlssup.o):tlssup.c:(.tls+0x0): multiple definition of `_tls_used' C:\boost\mingw/Lib/libboost_thread.a(tss_pe.o):tss_pe.cpp:(.rdata$T+0x0): first defined here

modify “boost_1_63_0/libs/thread/src/win32/tss_pe.cpp”

#if defined(__MINGW64__) || (__MINGW64_VERSION_MAJOR) || (__MINGW32_MAJOR_VERSION >3) ||             \
    ((__MINGW32_MAJOR_VERSION==3) && (__MINGW32_MINOR_VERSION>=18))

I've changed it to:

#if defined(__MINGW64__) || (__MINGW64_VERSION_MAJOR) || (__MINGW32__) || (__MINGW32_MAJOR_VERSION >3) ||             \
    ((__MINGW32_MAJOR_VERSION==3) && (__MINGW32_MINOR_VERSION>=18))

comment:2 by ljx0305@…, 6 years ago

modify

comment:3 by viboes, 5 years ago

Owner: changed from Anthony Williams to viboes
Status: newassigned

comment:4 by viboes, 5 years ago

I don't know if this is the good change.

I no one is against I will apply it this weekend. We will see on the regression tests how it behaves.

comment:6 by viboes, 5 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.