compiletheworld commented on code in PR #9815:
URL: https://github.com/apache/incubator-doris/pull/9815#discussion_r886313748
##########
thirdparty/build-thirdparty.sh:
##########
@@ -312,14 +312,17 @@ build_protobuf() {
LDFLAGS="-L${TP_LIB_DIR} -static-libstdc++ -static-libgcc
-Wl,--undefined=pthread_create" \
./configure --prefix=${TP_INSTALL_DIR} --disable-shared --enable-static
--with-zlib=${TP_INSTALL_DIR}/include
- # ATTN: If protoc is built fully statically with clang-14 on ubuntu,
- # it may core dump when parse some protobuf source files.
- # The root cause remains unknown, but it is possibly related glibc...
- # And, we don't actually need to be that static,
- # dyn-linking to glibc and etc. is OK
- # cd src
- # sed -i 's/^AM_LDFLAGS\(.*\)$/AM_LDFLAGS\1 -all-static/' Makefile
- # cd -
+ # ATTN: If protoc is not built fully statically the linktime libc may
newer than runtime.
Review Comment:
> this is not a problem with ldd, it is because of higher version gcc or
clang will link glibc new than 2.12, and for old version linux such as centos 6
only contain glibc lower than 2.12
@yangzhg
Sorry, I didn't make it clear,
1. Command `which ld` is for the linker info, in your env. it may be
`/usr/bin/ld` or `${path_to_ldb_toolchain}/bin/ld`
2. Command `ldd protoc` is for the dyn-linkage info of protoc, the result of
linking
3. Command `ldd --version` is for version checking of glibc of you env.
With the given info, it seems that protoc was built using the system's
default linker `/usr/bin/ld` instead of `${path_to_ldb_toolchain}/bin/ld`?
To confirm that, you can check out
`thirdparty/src/protobuf-${version}/config.log`, by `grep`ing this line
"checking if the linker", for more info. about how protoc was built and linked.
**Your patch works**, however, we can figure out why that version messed up
if you are interested in digging config.log.
BTW, we can also try to fix the wrong version of dyn-linked glibc by
modifying protoc binary
```
patchelf --replace-needed libc.so.6 ${path_to_ldb_toolchain}/lib/libc.so.6
protoc
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]