Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 718cf5bf authored by Ryan Prichard's avatar Ryan Prichard
Browse files

Define libc++ config macros to nothing

libc++[abi] always check whether one of these macros is defined, not
the value the macro is defined to. With the new libc++, there is a
Windows __config_site header that automatically defines
_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS and _LIBCPP_HAS_THREAD_API_WIN32
to nothing, so these definitions need to match to avoid a redefinition
error.

Bug: 175635923
Test: treehugger
Test: m adb
Change-Id: I1e48947c3b45e59804cdacd48776c7f3bd9a18c6
parent 8bf30138
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -205,12 +205,14 @@ func (stl *stl) flags(ctx ModuleContext, flags Flags) Flags {
			flags.extraLibFlags = append(flags.extraLibFlags, "-nostdlib++")
			if ctx.Windows() {
				flags.Local.CppFlags = append(flags.Local.CppFlags,
					// Disable visiblity annotations since we're using static
					// libc++.
					"-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
					"-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS",
					// These macros can also be defined by libc++'s __config
					// or __config_site headers so define them the same way
					// (i.e. to nothing). Disable visibility annotations since
					// we're using static libc++.
					"-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS=",
					"-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS=",
					// Use Win32 threads in libc++.
					"-D_LIBCPP_HAS_THREAD_API_WIN32")
					"-D_LIBCPP_HAS_THREAD_API_WIN32=")
			}
		}
	case "libstdc++":