Skip to content

Commit 2116723

Browse files
committed
Merge remote-tracking branch 'origin/develop'
2 parents b6a1b07 + d80687a commit 2116723

File tree

2 files changed

+36
-15
lines changed

2 files changed

+36
-15
lines changed

bin/llvm-kompile-clang

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -226,23 +226,38 @@ else
226226
fi
227227

228228
if $link; then
229+
runtime_components=(
230+
"$LIBDIR"/libarithmetic.a
231+
"$LIBDIR"/libutil.a
232+
"$LIBDIR"/libstrings.a
233+
"$LIBDIR"/libnumeric_strings.a
234+
"$LIBDIR"/libio.a
235+
"$LIBDIR"/libcollections.a
236+
"$LIBDIR"/libBindingsCore.a
237+
"$LIBDIR"/libKOREPrinter.a
238+
"$LIBDIR"/liballoc.a
239+
"$LIBDIR"/libcollect.a
240+
"$LIBDIR"/libmeta.a
241+
"$LIBDIR"/libjson.a
242+
)
243+
244+
components=(
245+
"$LIBDIR"/libParser.a
246+
"$LIBDIR"/libAST.a
247+
"$LIBDIR"/libBinaryKore.a
248+
)
249+
250+
# If we're linking a Python AST bindings module, then we don't want to include
251+
# the backend's runtime components. On some platforms and build type
252+
# combinations, the linker won't strip undefined symbols for us, which
253+
# produces an error on trying to load the Python library.
254+
if [ "$main" != "python_ast" ]; then
255+
components=("${components[@]}" "${runtime_components[@]}")
256+
fi
257+
229258
run @CMAKE_CXX_COMPILER@ -Wno-override-module -Wno-return-type-c-linkage "$modopt" "${files[@]}" \
230-
"$LIBDIR"/libarithmetic.a \
231259
"$MAINFILES" \
232-
"$LIBDIR"/libutil.a \
233-
"$LIBDIR"/libstrings.a \
234-
"$LIBDIR"/libnumeric_strings.a \
235-
"$LIBDIR"/libio.a \
236-
"$LIBDIR"/libcollections.a \
237-
"$LIBDIR"/libParser.a \
238-
"$LIBDIR"/libAST.a \
239-
"$LIBDIR"/libBindingsCore.a \
240-
"$LIBDIR"/libBinaryKore.a \
241-
"$LIBDIR"/libKOREPrinter.a \
242-
"$LIBDIR"/liballoc.a \
243-
"$LIBDIR"/libcollect.a \
244-
"$LIBDIR"/libmeta.a \
245-
"$LIBDIR"/libjson.a \
260+
"${components[@]}" \
246261
"${flags[@]}" \
247262
"${all_libraries[@]}" \
248263
-I "$(dirname "$0")"/../include/kllvm \

test/python/test_pythonast.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# RUN: mkdir -p %t
2+
# RUN: llvm-kompile pythonast --python %py-interpreter --python-output-dir %t
3+
# RUN: cd %t
4+
# RUN: PYTHONPATH=. %py-interpreter %s
5+
6+
import _kllvm

0 commit comments

Comments
 (0)