Skip to content

Commit 1a7b49c

Browse files
committed
Use llvm-ar and llvm-nm on macOS to avoid wired things (#172)
1 parent 1cdf7a8 commit 1a7b49c

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

.github/workflows/build_wheels.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,13 @@ jobs:
235235
- name: Debug libchdb
236236
run: |
237237
ls -lh
238-
nm libchdb.so | grep query_stable || true
238+
llvm-nm libchdb.so | grep query_stable || true
239239
echo "Global Symbol in libchdb.so:"
240-
nm -g libchdb.so || true
240+
llvm-nm -g libchdb.so || true
241241
echo "Global Symbol in libclickhouse-local-chdb.a:"
242-
nm -g buildlib/programs/local/libclickhouse-local-chdb.a || true
242+
llvm-nm -g buildlib/programs/local/libclickhouse-local-chdb.a || true
243243
echo "Global Symbol in libclickhouse-local-lib.a:"
244-
nm -g buildlib/programs/local/libclickhouse-local-lib.a || true
244+
llvm-nm -g buildlib/programs/local/libclickhouse-local-lib.a || true
245245
echo "pychdb_cmd.sh:"
246246
cat buildlib/pychdb_cmd.sh
247247
echo "libchdb_cmd.sh:"

chdb/build.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ ${PYCHDB_CMD}
145145
LIBCHDB_SO="libchdb.so"
146146
CLEAN_CHDB_A="libclickhouse-local-chdb.a"
147147
cp -a ${BUILD_DIR}/programs/local/libclickhouse-local-lib.a ${BUILD_DIR}/programs/local/libclickhouse-local-lib.a.bak
148-
ar d ${BUILD_DIR}/programs/local/libclickhouse-local-lib.a LocalChdb.cpp.o
148+
${AR} d ${BUILD_DIR}/programs/local/libclickhouse-local-lib.a LocalChdb.cpp.o
149149
mv ${BUILD_DIR}/programs/local/libclickhouse-local-lib.a ${BUILD_DIR}/programs/local/${CLEAN_CHDB_A}
150150
mv ${BUILD_DIR}/programs/local/libclickhouse-local-lib.a.bak ${BUILD_DIR}/programs/local/libclickhouse-local-lib.a
151151
ls -l ${BUILD_DIR}/programs/local/
@@ -192,10 +192,10 @@ cp -a ${PYCHDB} ${CHDB_DIR}/${CHDB_PY_MODULE}
192192
cp -a ${LIBCHDB} ${PROJ_DIR}/${LIBCHDB_SO}
193193

194194
echo -e "\nSymbols:"
195-
nm ${PYCHDB} | grep PyInit || true
196-
nm ${LIBCHDB} | grep PyInit || true
197-
nm ${PYCHDB} | grep query_stable || true
198-
nm ${LIBCHDB} | grep query_stable || true
195+
${NM} ${PYCHDB} | grep PyInit || true
196+
${NM} ${LIBCHDB} | grep PyInit || true
197+
${NM} ${PYCHDB} | grep query_stable || true
198+
${NM} ${LIBCHDB} | grep query_stable || true
199199

200200
echo -e "\nAfter copy:"
201201
cd ${PROJ_DIR} && pwd

chdb/vars.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ popd
1212
# check current os type, and make ldd command
1313
if [ "$(uname)" == "Darwin" ]; then
1414
LDD="otool -L"
15+
AR="llvm-ar"
16+
NM="llvm-nm"
1517
elif [ "$(uname)" == "Linux" ]; then
1618
LDD="ldd"
19+
AR="ar"
20+
NM="nm"
1721
else
1822
echo "OS not supported"
1923
exit 1

0 commit comments

Comments
 (0)