Mir

Merge lp:~thomas-voss/mir/add-pthread-linker-and-preprocessor-flags-2 into lp:mir

Proposed by Thomas Voß
Status: Merged
Approved by: Daniel van Vugt
Approved revision: no longer in the source branch.
Merged at revision: 1128
Proposed branch: lp:~thomas-voss/mir/add-pthread-linker-and-preprocessor-flags-2
Merge into: lp:mir
Diff against target: 48 lines (+3/-5)
3 files modified
3rd_party/android-input/android/CMakeLists.txt (+0/-1)
CMakeLists.txt (+3/-3)
src/shared/protobuf/CMakeLists.txt (+0/-1)
To merge this branch: bzr merge lp:~thomas-voss/mir/add-pthread-linker-and-preprocessor-flags-2
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Daniel van Vugt Approve
Alan Griffiths Approve
Loïc Minier Approve
Review via email: mp+190432@code.launchpad.net

Commit message

Ensure -pthread is correctly passed to compiler and linker.

Description of the change

Ensure -pthread is correctly passed to compiler and linker.

To post a comment you must log in.
Revision history for this message
Loïc Minier (lool) wrote :

Just wanted to +1 this change as there might be subtle breakage without it on some architecture / library combinations.

review: Approve
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

LGTM

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Ignore the Jenkins failure. A fix for that should land soon.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Is this for bug 1233988 still?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

This is incorrect and redundant:
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pthread -Wl,--no-undefined")

Incorrect because it loses existing CMAKE_EXE_LINKER_FLAGS. And redundant because if you scroll down you'll find we already have:
  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")

review: Needs Fixing
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Also, AFAIK, C_FLAGS and CXX_FLAGS apply to link targets as well as compilation. So you don't need to mention any *LINKER_FLAGS.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Seems to work. "-pthread" is appearing on link lines just from C(XX)_FLAGS, as desired.

I'm concerned about quietly changing the language spec though:
  -std=c++11
I think we should propose that separately in case it causes any behavioural changes.

review: Needs Fixing
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Alrightee.

This is unnecessary:
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-undefined")
but if it builds, then good to have.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '3rd_party/android-input/android/CMakeLists.txt'
2--- 3rd_party/android-input/android/CMakeLists.txt 2013-05-30 19:24:29 +0000
3+++ 3rd_party/android-input/android/CMakeLists.txt 2013-10-11 07:42:10 +0000
4@@ -64,7 +64,6 @@
5 android-input
6
7 ${Boost_LIBRARIES}
8- -lpthread
9 )
10
11 set_target_properties(
12
13=== modified file 'CMakeLists.txt'
14--- CMakeLists.txt 2013-10-09 07:04:15 +0000
15+++ CMakeLists.txt 2013-10-11 07:42:10 +0000
16@@ -42,9 +42,10 @@
17 include (cmake/PrePush.cmake)
18 include (GNUInstallDirs)
19
20-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Werror -Wall -pedantic -Wextra -fPIC")
21-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++0x -Werror -Wall -fno-strict-aliasing -pedantic -Wnon-virtual-dtor -Wextra -fPIC")
22+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread -g -Werror -Wall -pedantic -Wextra -fPIC")
23+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -g -std=c++0x -Werror -Wall -fno-strict-aliasing -pedantic -Wnon-virtual-dtor -Wextra -fPIC")
24 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
25+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-undefined")
26
27 if ("${CMAKE_CXX_COMPILER}" MATCHES "clang")
28 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage -Wno-mismatched-tags")
29@@ -115,7 +116,6 @@
30 include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/3rd_party/android-deps)
31 list(APPEND CMAKE_SYSTEM_INCLUDE_PATH "${PROJECT_SOURCE_DIR}/3rd_party/android-deps")
32
33- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
34 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
35
36 add_definitions( -DANDROID )
37
38=== modified file 'src/shared/protobuf/CMakeLists.txt'
39--- src/shared/protobuf/CMakeLists.txt 2013-08-28 03:41:48 +0000
40+++ src/shared/protobuf/CMakeLists.txt 2013-10-11 07:42:10 +0000
41@@ -33,7 +33,6 @@
42 mirprotobuf
43
44 ${PROTOBUF_LIBRARIES}
45- -lpthread
46 )
47
48 # Export the include directories

Subscribers

People subscribed via source and target branches