Smallfu666 commented on issue #12316:
URL: https://github.com/apache/gluten/issues/12316#issuecomment-5161711281

   Reproduced on Ubuntu 22.04 with the current non-vcpkg Velox build 
(`VELOX_BUILD_SHARED=OFF`): linking `libvelox.so` fails with
   
   ```
   /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgflags.a(gflags.cc.o): relocation 
R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making 
a shared object; recompile with -fPIC
   ```
   
   Folly exports a dependency on `gflags_static`, which resolves to Ubuntu's 
non-PIC `/usr/lib/x86_64-linux-gnu/libgflags.a`. As a control, the same build 
with `VELOX_BUILD_SHARED=ON` succeeds (it uses the shared gflags target).
   
   Building the pinned gflags from source with PIC (shared + static) resolves 
the relocation and produces a valid `libvelox.so`. One caveat: replacing only 
gflags can leave apt glog pulling apt `libgflags.so.2.2` at runtime alongside 
the source gflags 2.3 — source-building the pinned glog as well avoids that mix.
   
   I'm not opening a PR yet: `process_setup_ubuntu` is shared by 
Ubuntu/Debian/Pop!_OS and isn't build-mode-specific, so an unconditional change 
would also touch configs that don't reproduce the failure (e.g. 
`VELOX_BUILD_SHARED=ON`). A proper fix should gate the source gflags/glog build 
to the affected static-dependency configuration.
   
   (Testing note: in my run the build wrapper didn't propagate the native link 
failure through its exit status, so check for `libvelox.so` and the linker log 
directly rather than the exit code.)
   


-- 
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]

Reply via email to