File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,8 @@ AS_IF([test "x$enable_apple_tsd_optimizations" = "xyes"],
94
94
[ Define to use non-portable pthread TSD optimizations for Mac OS X)] ) ]
95
95
)
96
96
97
+ AC_CANONICAL_TARGET
98
+
97
99
#
98
100
# Enable building Swift overlay support into libdispatch
99
101
#
@@ -102,11 +104,21 @@ AC_ARG_WITH([swift-toolchain],
102
104
[ swift_toolchain_path=${withval}
103
105
AC_DEFINE ( HAVE_SWIFT , 1 , [ Define if building for Swift] )
104
106
SWIFTC="$swift_toolchain_path/bin/swiftc"
107
+ case $target_os in
108
+ linux*)
109
+ os_string="linux"
110
+ ;;
111
+ *)
112
+ os_string=$target_os
113
+ ;;
114
+ esac
115
+ SWIFT_LIBDIR="$swift_toolchain_path/lib/swift/$os_string/$target_cpu"
105
116
have_swift=true] ,
106
117
[ have_swift=false]
107
118
)
108
119
AM_CONDITIONAL(HAVE_SWIFT, $have_swift)
109
120
AC_SUBST ( [ SWIFTC] )
121
+ AC_SUBST ( [ SWIFT_LIBDIR] )
110
122
111
123
#
112
124
# Enable use of gold linker when building the Swift overlay
@@ -120,7 +132,6 @@ AM_CONDITIONAL(USE_GOLD_LINKER, $use_gold_linker)
120
132
# Enable __thread based TSD on platforms where it is efficient
121
133
# Allow override based on command line argument to configure
122
134
#
123
- AC_CANONICAL_TARGET
124
135
AC_ARG_ENABLE ( [ thread-local-storage] ,
125
136
[ AS_HELP_STRING ( [ --enable-thread-local-storage] ,
126
137
[ Enable usage of thread local storage via __thread] ) ] ,,
Original file line number Diff line number Diff line change @@ -185,3 +185,13 @@ SOURCE(SIGNAL)
185
185
SOURCE(TIMER)
186
186
SOURCE(VNODE)
187
187
SOURCE(WRITE)
188
+
189
+ // See comment in CFFuntime.c explaining why objc_retainAutoreleasedReturnValue is needed.
190
+ extern "C" void swift_release(void *);
191
+ extern " C" void * objc_retainAutoreleasedReturnValue (void *obj) {
192
+ if (obj) {
193
+ swift_release (obj);
194
+ return obj;
195
+ }
196
+ else return NULL ;
197
+ }
Original file line number Diff line number Diff line change @@ -121,7 +121,11 @@ if HAVE_PTHREAD_WORKQUEUES
121
121
endif
122
122
endif
123
123
124
- LDADD =libbsdtests.la $(top_builddir ) /src/libdispatch.la $(KQUEUE_LIBS ) $(PTHREAD_WORKQUEUE_LIBS ) $(BSD_OVERLAY_LIBS )
124
+ if HAVE_SWIFT
125
+ SWIFT_LIBS =-L$(SWIFT_LIBDIR ) -lswiftCore
126
+ endif
127
+
128
+ LDADD =libbsdtests.la $(top_builddir ) /src/libdispatch.la $(KQUEUE_LIBS ) $(PTHREAD_WORKQUEUE_LIBS ) $(BSD_OVERLAY_LIBS ) $(SWIFT_LIBS )
125
129
libbsdtests_la_LDFLAGS =-avoid-version
126
130
127
131
bsdtestsummarize_LDADD =-lm $(BSD_OVERLAY_LIBS )
You can’t perform that action at this time.
0 commit comments