From 63a205d4a00670298f0c3568ba7af8c5a1b3fee2 Mon Sep 17 00:00:00 2001 From: Jon Olav Hauglid Date: Mon, 21 Oct 2013 13:14:46 +0200 Subject: [PATCH] Bug#17632386: WITH_ASAN CONFLICTS WITH -WL,--NO-UNDEFINED MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Wl,--no-undefined (=-z defs) gives linking errors when used with WITH_ASAN. According to the documentation: "When linking shared libraries, the AddressSanitizer run-time is not linked, so -Wl,-z,defs may cause link errors (don’t use it with AddressSanitizer)." This patch turns off -Wl,--no-undefined if WITH_ASAN is used. --- cmake/os/Linux.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake/os/Linux.cmake b/cmake/os/Linux.cmake index 61361d1d48b..5a1bd2f2d0d 100644 --- a/cmake/os/Linux.cmake +++ b/cmake/os/Linux.cmake @@ -1,5 +1,5 @@ -# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -33,7 +33,10 @@ ENDFOREACH() # Ensure we have clean build for shared libraries # without unresolved symbols -SET(LINK_FLAG_NO_UNDEFINED "-Wl,--no-undefined") +# Not supported with AddressSanitizer +IF(NOT WITH_ASAN) + SET(LINK_FLAG_NO_UNDEFINED "-Wl,--no-undefined") +ENDIF() # 64 bit file offset support flag SET(_FILE_OFFSET_BITS 64)