Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use llvm-ar and llvm-nm on macOS to avoid wired things #172

Merged
merged 1 commit into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,13 @@ jobs:
- name: Debug libchdb
run: |
ls -lh
nm libchdb.so | grep query_stable || true
llvm-nm libchdb.so | grep query_stable || true
echo "Global Symbol in libchdb.so:"
nm -g libchdb.so || true
llvm-nm -g libchdb.so || true
echo "Global Symbol in libclickhouse-local-chdb.a:"
nm -g buildlib/programs/local/libclickhouse-local-chdb.a || true
llvm-nm -g buildlib/programs/local/libclickhouse-local-chdb.a || true
echo "Global Symbol in libclickhouse-local-lib.a:"
nm -g buildlib/programs/local/libclickhouse-local-lib.a || true
llvm-nm -g buildlib/programs/local/libclickhouse-local-lib.a || true
echo "pychdb_cmd.sh:"
cat buildlib/pychdb_cmd.sh
echo "libchdb_cmd.sh:"
Expand Down
10 changes: 5 additions & 5 deletions chdb/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ ${PYCHDB_CMD}
LIBCHDB_SO="libchdb.so"
CLEAN_CHDB_A="libclickhouse-local-chdb.a"
cp -a ${BUILD_DIR}/programs/local/libclickhouse-local-lib.a ${BUILD_DIR}/programs/local/libclickhouse-local-lib.a.bak
ar d ${BUILD_DIR}/programs/local/libclickhouse-local-lib.a LocalChdb.cpp.o
${AR} d ${BUILD_DIR}/programs/local/libclickhouse-local-lib.a LocalChdb.cpp.o
mv ${BUILD_DIR}/programs/local/libclickhouse-local-lib.a ${BUILD_DIR}/programs/local/${CLEAN_CHDB_A}
mv ${BUILD_DIR}/programs/local/libclickhouse-local-lib.a.bak ${BUILD_DIR}/programs/local/libclickhouse-local-lib.a
ls -l ${BUILD_DIR}/programs/local/
Expand Down Expand Up @@ -192,10 +192,10 @@ cp -a ${PYCHDB} ${CHDB_DIR}/${CHDB_PY_MODULE}
cp -a ${LIBCHDB} ${PROJ_DIR}/${LIBCHDB_SO}

echo -e "\nSymbols:"
nm ${PYCHDB} | grep PyInit || true
nm ${LIBCHDB} | grep PyInit || true
nm ${PYCHDB} | grep query_stable || true
nm ${LIBCHDB} | grep query_stable || true
${NM} ${PYCHDB} | grep PyInit || true
${NM} ${LIBCHDB} | grep PyInit || true
${NM} ${PYCHDB} | grep query_stable || true
${NM} ${LIBCHDB} | grep query_stable || true

echo -e "\nAfter copy:"
cd ${PROJ_DIR} && pwd
Expand Down
4 changes: 4 additions & 0 deletions chdb/vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ popd
# check current os type, and make ldd command
if [ "$(uname)" == "Darwin" ]; then
LDD="otool -L"
AR="llvm-ar"
NM="llvm-nm"
elif [ "$(uname)" == "Linux" ]; then
LDD="ldd"
AR="ar"
NM="nm"
else
echo "OS not supported"
exit 1
Expand Down
Loading