Skip to content

Commit a612542

Browse files
committed
Replace the --defsym linker argument with an alias in code
- This has the same effect as the -defsym=__CFConstantStringClassReference=_T010Foundation19_NSCFConstantStringCN option but does it in code which allows simplifying the linker arguments.
1 parent fa7a645 commit a612542

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

CoreFoundation/Base.subproj/CFInternal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ CF_EXPORT void * __CFConstantStringClassReferencePtr;
349349

350350
#if DEPLOYMENT_RUNTIME_SWIFT
351351

352-
CF_EXPORT void *__CFConstantStringClassReference[];
352+
CF_EXPORT void *__CFConstantStringClassReference[] asm("_T010Foundation19_NSCFConstantStringCN");
353353

354354
#if __CF_BIG_ENDIAN__
355355
#define CF_CONST_STRING_INFO {0x00, 0x00, 0x07, 0xc8}

build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
swift_cflags = ['-DDEPLOYMENT_RUNTIME_SWIFT']
1717
if Configuration.current.target.sdk == OSType.Linux:
1818
foundation.CFLAGS = '-DDEPLOYMENT_TARGET_LINUX -D_GNU_SOURCE -DCF_CHARACTERSET_DATA_DIR="CoreFoundation/CharacterSets"'
19-
foundation.LDFLAGS = '${SWIFT_USE_LINKER} -Wl,@./CoreFoundation/linux.ld -lswiftGlibc `${PKG_CONFIG} icu-uc icu-i18n --libs` -Wl,-defsym,__CFConstantStringClassReference=_T010Foundation19_NSCFConstantStringCN -Wl,-Bsymbolic '
19+
foundation.LDFLAGS = '${SWIFT_USE_LINKER} -Wl,@./CoreFoundation/linux.ld -lswiftGlibc `${PKG_CONFIG} icu-uc icu-i18n --libs` -Wl,-Bsymbolic '
2020
Configuration.current.requires_pkg_config = True
2121
elif Configuration.current.target.sdk == OSType.FreeBSD:
2222
foundation.CFLAGS = '-DDEPLOYMENT_TARGET_FREEBSD -I/usr/local/include -I/usr/local/include/libxml2 -I/usr/local/include/curl '
@@ -26,7 +26,7 @@
2626
foundation.LDFLAGS = '-licucore -twolevel_namespace -Wl,-alias_list,CoreFoundation/Base.subproj/DarwinSymbolAliases -sectcreate __UNICODE __csbitmaps CoreFoundation/CharacterSets/CFCharacterSetBitmaps.bitmap -sectcreate __UNICODE __properties CoreFoundation/CharacterSets/CFUniCharPropertyDatabase.data -sectcreate __UNICODE __data CoreFoundation/CharacterSets/CFUnicodeData-L.mapping -segprot __UNICODE r r '
2727
elif Configuration.current.target.sdk == OSType.Win32 and Configuration.current.target.environ == EnvironmentType.Cygnus:
2828
foundation.CFLAGS = '-DDEPLOYMENT_TARGET_LINUX -D_GNU_SOURCE -mcmodel=large '
29-
foundation.LDFLAGS = '${SWIFT_USE_LINKER} -lswiftGlibc `icu-config --ldflags` -Wl,-defsym,__CFConstantStringClassReference=_T010Foundation19_NSCFConstantStringCN,--allow-multiple-definition '
29+
foundation.LDFLAGS = '${SWIFT_USE_LINKER} -lswiftGlibc `icu-config --ldflags` -Wl,--allow-multiple-definition '
3030
swift_cflags += ['-DCYGWIN']
3131

3232
if Configuration.current.build_mode == Configuration.Debug:

0 commit comments

Comments
 (0)