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
=== modified file '3rd_party/android-input/android/CMakeLists.txt'
--- 3rd_party/android-input/android/CMakeLists.txt 2013-05-30 19:24:29 +0000
+++ 3rd_party/android-input/android/CMakeLists.txt 2013-10-11 07:42:10 +0000
@@ -64,7 +64,6 @@
64 android-input64 android-input
6565
66 ${Boost_LIBRARIES}66 ${Boost_LIBRARIES}
67 -lpthread
68)67)
6968
70set_target_properties(69set_target_properties(
7170
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2013-10-09 07:04:15 +0000
+++ CMakeLists.txt 2013-10-11 07:42:10 +0000
@@ -42,9 +42,10 @@
42include (cmake/PrePush.cmake)42include (cmake/PrePush.cmake)
43include (GNUInstallDirs)43include (GNUInstallDirs)
4444
45set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Werror -Wall -pedantic -Wextra -fPIC")45set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread -g -Werror -Wall -pedantic -Wextra -fPIC")
46set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++0x -Werror -Wall -fno-strict-aliasing -pedantic -Wnon-virtual-dtor -Wextra -fPIC")46set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -g -std=c++0x -Werror -Wall -fno-strict-aliasing -pedantic -Wnon-virtual-dtor -Wextra -fPIC")
47set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")47set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
48set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-undefined")
4849
49if ("${CMAKE_CXX_COMPILER}" MATCHES "clang")50if ("${CMAKE_CXX_COMPILER}" MATCHES "clang")
50 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage -Wno-mismatched-tags")51 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage -Wno-mismatched-tags")
@@ -115,7 +116,6 @@
115 include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/3rd_party/android-deps)116 include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/3rd_party/android-deps)
116 list(APPEND CMAKE_SYSTEM_INCLUDE_PATH "${PROJECT_SOURCE_DIR}/3rd_party/android-deps")117 list(APPEND CMAKE_SYSTEM_INCLUDE_PATH "${PROJECT_SOURCE_DIR}/3rd_party/android-deps")
117118
118 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
119 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")119 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
120120
121 add_definitions( -DANDROID )121 add_definitions( -DANDROID )
122122
=== modified file 'src/shared/protobuf/CMakeLists.txt'
--- src/shared/protobuf/CMakeLists.txt 2013-08-28 03:41:48 +0000
+++ src/shared/protobuf/CMakeLists.txt 2013-10-11 07:42:10 +0000
@@ -33,7 +33,6 @@
33 mirprotobuf33 mirprotobuf
3434
35 ${PROTOBUF_LIBRARIES}35 ${PROTOBUF_LIBRARIES}
36 -lpthread
37)36)
3837
39# Export the include directories38# Export the include directories

Subscribers

People subscribed via source and target branches