protocolbuffers / protobuf

Protocol Buffers - Google's data interchange format
http://protobuf.dev
Other
65.24k stars 15.45k forks source link

Ruby gem fails to compile under x86_64-linux-gnux32 on bookworm #17068

Open haileys opened 3 months ago

haileys commented 3 months ago
linking shared-object google/protobuf_c.so
/usr/bin/ld: protobuf_c.so: no symbol version section for versioned symbol `memcpy@GLIBC_2.2.5'
collect2: error: ld returned 1 exit status
make: *** [Makefile:265: protobuf_c.so] Error 1

This is due to the wrap_memcpy.c, which appears to force the memcpy symbol to link against a specific version exported by glibc.

Removing the wrap_memcpy code fixes the issue.

haileys commented 3 months ago

It appears that Debian bookworm's libc6-x32 only provides the GLIBC_2.16 version of this symbol

$ objdump -T /usr/libx32/libc.so.6 | grep memcpy
000aae50  w   DF .text  00000008  GLIBC_2.16  wmemcpy
00110730 g    DF .text  00000018  GLIBC_2.16  __wmemcpy_chk
0010f470 g   iD  .text  00000107  GLIBC_2.16  __memcpy_chk
00095fc0 g   iD  .text  00000107  GLIBC_2.16  memcpy
haileys commented 3 months ago

This can also be fixed by adding && !defined(__ILP32__) to the #if defined(__x86_64__) && defined(__GNU_LIBRARY__) preprocessor condition in wrap_memcpy.c

acozzette commented 3 months ago

Thank you for the bug report. Your suggested fix sounds good to me if you would like to send us a pull request.

github-actions[bot] commented 1 week ago

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.

This issue is labeled inactive because the last activity was over 90 days ago. This issue will be closed and archived after 14 additional days without activity.