Skip to content

Commit 8a71897

Browse files
thughesajordanr-google
authored andcommitted
[libc++] Make _LIBCPP_MAKE_OVERRIDABLE_FUNCTION_DETECTABLE a no-op on baremetal
Baremetal targets tend to use custom linker scripts, which may not include the __lcxx_override section. BUG=b:363082822 patch.cherry: false patch.platforms: chromiumos patch.version_range.from: 530567 patch.version_range.until: null Change-Id: Ibfd20a98eddb655b90eda7c99e72bfc1f9613c69
1 parent 2677ad4 commit 8a71897

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

libcxx/src/include/overridable_function.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,14 @@
6363
// want to be defining special sections inside user's executables which use our headers.
6464
//
6565

66-
#if defined(_LIBCPP_OBJECT_FORMAT_MACHO)
66+
// Baremetal targets tend to use custom linker scripts, which may not include
67+
// the __lcxx_override section.
68+
#if defined(LIBCXXABI_BAREMETAL)
69+
70+
# define _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION 0
71+
# define _LIBCPP_MAKE_OVERRIDABLE_FUNCTION_DETECTABLE /* nothing */
72+
73+
#elif defined(_LIBCPP_OBJECT_FORMAT_MACHO)
6774

6875
# define _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION 1
6976
# define _LIBCPP_MAKE_OVERRIDABLE_FUNCTION_DETECTABLE \

0 commit comments

Comments
 (0)