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

Need to manually add ./google/protobuf/.libs/descriptor.pb.o to get protoc to link #5144

Closed
sweetcw opened this issue Sep 13, 2018 · 12 comments

Comments

@sweetcw
Copy link

sweetcw commented Sep 13, 2018

Link error: undefined reference to 'scc_info_FileDescriptorProto_google_2fprotobuf_2fdescriptor_2eproto'

Using an ARM docker to compile for ARM Yocto environment. Apply patch found here so autogen will work.

bash-4.3# g++ --version
g++ (GCC) 4.9.3
bash-4.3# libtool --version
libtool (GNU libtool) 2.4.6

Commands:
bash-4.3# ./autogen
bash-4.3# ./configure
bash-4.3# make

Get the following error:
/bin/bash ../libtool --tag=CXX --mode=link g++ -pthread -DHAVE_PTHREAD=1 -DHAVE_ZLIB=1 -Wall -Wno-sign-compare -O2 -g -std=c++11 -DNDEBUG -pthread -o protoc goo
gle/protobuf/compiler/main.o libprotobuf.la libprotoc.la -lz
libtool: link: g++ -pthread -DHAVE_PTHREAD=1 -DHAVE_ZLIB=1 -Wall -Wno-sign-compare -O2 -g -std=c++11 -DNDEBUG -pthread -o .libs/protoc google/protobuf/compiler/main
.o ./.libs/libprotobuf.so ./.libs/libprotoc.so /home/root/protobuf/src/.libs/libprotobuf.so /usr/lib/libstdc++.so -lm -lz -pthread -Wl,-rpath -Wl,/usr/local/lib
./.libs/libprotoc.so: error: undefined reference to 'scc_info_FileDescriptorProto_google_2fprotobuf_2fdescriptor_2eproto'
collect2: error: ld returned 1 exit status
Makefile:3499: recipe for target 'protoc' failed
make[2]: *** [protoc] Error 1
make[2]: Leaving directory '/home/root/protobuf/src'
Makefile:1559: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/root/protobuf'
Makefile:1466: recipe for target 'all' failed
make: *** [all] Error 2

To resolve I call the following:
bash-4.3# cd src
bash-4.3# /bin/bash ../libtool --tag=CXX --mode=link g++ -pthread -DHAVE_PTHREAD=1 -DHAVE_ZLIB=1 -Wall -Wno-sign-compare -O2 -g -std=c++11 -DNDEBUG -pthread -o pro
toc google/protobuf/compiler/main.o libprotobuf.la libprotoc.la ./google/protobuf/.libs/descriptor.pb.o -lz

Help avoiding the last manual step so make completes successfully on its own would be appreciated. TIA!

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Sep 14, 2018

Try cmake instead? We are considering deprecating/removing the autotools support.

@VNDJ
Copy link

VNDJ commented Sep 17, 2018

I got the same error, and it was solved by run the cmd manually!

@sweetcw
Copy link
Author

sweetcw commented Sep 18, 2018

CMake does build and run without error. It's not obvious cmake is supported for Linux, the instructions only mention Windows. For those that run into this in the future, here are the commands I used for building for Linux:

cd protobuf/cmake
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -Dprotobuf_BUILD_TESTS=OFF ../
make -j16

@sweetcw sweetcw closed this as completed Sep 18, 2018
@blueberryCoder
Copy link

i got the same error i use ndk for android

@AsteriskZuo
Copy link

I have the same problem.
protobuf version 3.11.4.
Static library compilation is no problem. The dynamic library has been inaccessible.

@journey175
Copy link

I got the same question when cross-compile protobuf c++ 3.11.4 for arm-linux,
it describe the error : ./.libs/libprotoc.so : error: undefined reference to 'scc_info_FileDescriptorProto_google_2fprotobuf_2fdescriptor_2eproto',

@LourensVeen
Copy link
Contributor

I'm seeing this issue as well on some machines, when building using autotools. It's mentioned at #5107 that this is an issue with the GOLD linker, but I can reproduce it on GNU LD 2.30 (and GCC 7.3.0) as well, although it works fine on another machine also with GNU LD 2.30 and GCC 7.5.0.

It seems that the problem is that the scc_info_* and descriptor_table_* symbols are not extern "C++", and therefore on some linkers do not match the *google* wildcard in the version script. If I modify the src/libprotoc.map, src/libprotobuf.map and src/libprotobuf-lite.map files to read

{
  global:
    extern "C++" {
      *google*;
    };
    scc_info_*;
    descriptor_table_*;

  local:
    *;
};

then it builds correctly using autotools. Possible a broader *google*; pattern outside of the extern "C++" is a better solution in the long run, but this seems to be the minimal match needed on Protobuf 3.10.0 at least.

It looks like building with CMake is not really a fix, #6113 says that there's a bug in the CMake build leading it to not use the version scripts, which hides the problem (because all symbols are now public) but doesn't solve it properly. It may be good to reopen this issue because of this.

@journey175
Copy link

@LourensVeen thank you very much ,your reply solved my problem.

hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Sep 3, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.5-2.spec
    mv ../*protobuf*3.21.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.5/
    rm -rf ../*protobuf*3.21.5*.*

See protocolbuffers#5144 (comment)

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Sep 3, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.5-2.spec
    mv ../*protobuf*3.21.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.5/
    rm -rf ../*protobuf*3.21.5*.*

See protocolbuffers#5144 (comment)

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Sep 3, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.5-2.spec
    mv ../*protobuf*3.21.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.5/
    rm -rf ../*protobuf*3.21.5*.*

See protocolbuffers#5144 (comment)

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Sep 3, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.5-2.spec
    mv ../*protobuf*3.21.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.5/
    rm -rf ../*protobuf*3.21.5*.*

See protocolbuffers#5144 (comment)

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Sep 3, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.5-2.spec
    mv ../*protobuf*3.21.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.5/
    rm -rf ../*protobuf*3.21.5*.*

See protocolbuffers#5144 (comment)

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Sep 3, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.5-2.spec
    mv ../*protobuf*3.21.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.5/
    rm -rf ../*protobuf*.*

See protocolbuffers#5144 (comment)

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Sep 4, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.5-2.spec
    mv ../*protobuf*3.21.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.5/
    rm -rf ../*protobuf*.{deb,ddeb,build,buildinfo,changes}

See protocolbuffers#5144 (comment)

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Sep 4, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.5-2.spec
    mv ../*protobuf*3.21.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.5/
    rm -rf ../*protobuf*.{deb,ddeb,build,buildinfo,changes}

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Sep 4, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.5-2.spec
    mv ../*protobuf*3.21.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.5/
    rm -rf ../*protobuf*.{deb,ddeb,build,buildinfo,changes}

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Sep 4, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.5-2.spec
    mv ../*protobuf*3.21.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.5/
    rm -rf ../*protobuf*.{deb,ddeb,build,buildinfo,changes}

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Sep 4, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.5-2.spec
    mv ../*protobuf*3.21.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.5/
    rm -rf ../*protobuf*.{deb,ddeb,build,buildinfo,changes}

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Sep 7, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.5-2.spec
    mv ../*protobuf*3.21.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.5/
    rm -rf ../*protobuf*.{deb,ddeb,build,buildinfo,changes}

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Sep 7, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.5-2.spec
    mv ../*protobuf*3.21.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.5/
    rm -rf ../*protobuf*.{deb,ddeb,build,buildinfo,changes}

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Sep 7, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.5-1.spec
    mv ../*protobuf*3.21.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.5/
    rm -rf ../*protobuf*.{deb,ddeb,build,buildinfo,changes}

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Sep 7, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.5-1.spec
    mv ../*protobuf*3.21.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.5/
    rm -rf ../*protobuf*.{deb,ddeb,build,buildinfo,changes}

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Sep 7, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.5-1.spec
    mv ../*protobuf*3.21.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.5/
    rm -rf ../*protobuf*.{deb,ddeb,build,buildinfo,changes}

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Sep 7, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.5-1.spec
    mv ../*protobuf*3.21.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.5/
    rm -rf ../*protobuf*.{deb,ddeb,build,buildinfo,changes}

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Sep 7, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.5-1.spec
    mv ../*protobuf*3.21.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.5/
    rm -rf ../*protobuf*.{deb,ddeb,build,buildinfo,changes}

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Sep 7, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.5-1.spec
    mv ../*protobuf*3.21.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.5/
    rm -rf ../*protobuf*.{deb,ddeb,build,buildinfo,changes}

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch
See https://patch-diff.githubusercontent.com/raw/protocolbuffers/protobuf/pull/10403.diff

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Sep 7, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.5-1.spec
    mv ../*protobuf*3.21.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.5/
    rm -rf ../*protobuf*.{deb,ddeb,build,buildinfo,changes}

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch
See protocolbuffers#10403

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Sep 8, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.5-1.spec
    mv ../*protobuf*3.21.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.5/
    rm -rf ../*protobuf*.{deb,ddeb,build,buildinfo,changes}

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch
See protocolbuffers#10403

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Sep 11, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.5-1.spec
    mv ../*protobuf*3.21.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.5/
    rm -rf ../*proto*.{deb,ddeb,build,buildinfo,changes}

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch
See protocolbuffers#10403

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Sep 11, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.5-1.spec
    mv ../*protobuf*3.21.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.5/
    rm -rf ../*proto*3.21.5*.* ../python*-protobuf*4.21.5*.*

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch
See protocolbuffers#10403

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Sep 14, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.6.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.6-1.spec
    mv ../*protobuf*3.21.6*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.6/
    rm -rf ../*proto*3.21.6*.* ../python*-protobuf*4.21.6*.*

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch
See protocolbuffers#10403

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Sep 14, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.6.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.6-1.spec
    mv ../*protobuf*3.21.6*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.6/
    rm -rf ../*proto*3.21.6*.* ../python*-protobuf*4.21.6*.*

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch
See protocolbuffers#10403

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Sep 30, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.7.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.7-1.spec
    mv ../*protobuf*3.21.7*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.7/
    rm -rf ../*proto*3.21.7*.* ../python*-protobuf*4.21.7*.*

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch
See protocolbuffers#10403

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Oct 10, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.5-1.spec
    mv ../*protobuf*3.21.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.5/
    rm -rf ../*proto*3.21.5*.* ../python*-protobuf*4.21.5*.*

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch
See protocolbuffers#10403

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Oct 10, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.6.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.6-1.spec
    mv ../*protobuf*3.21.6*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.6/
    rm -rf ../*proto*3.21.6*.* ../python*-protobuf*4.21.6*.*

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch
See protocolbuffers#10403

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Oct 10, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.7.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.7-1.spec
    mv ../*protobuf*3.21.7*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.7/
    rm -rf ../*proto*3.21.7*.* ../python*-protobuf*4.21.7*.*

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch
See protocolbuffers#10403

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Oct 17, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.7.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.7-1.spec
    mv ../*protobuf*3.21.7*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.7/
    rm -rf ../*proto*3.21.7*.* ../python*-protobuf*4.21.7*.*

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch
See protocolbuffers#10403

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Oct 17, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.5.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.5-1.spec
    mv ../*protobuf*3.21.5*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.5/
    rm -rf ../*proto*3.21.5*.* ../python*-protobuf*4.21.5*.*

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch
See protocolbuffers#10403

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Oct 17, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.6.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.6-1.spec
    mv ../*protobuf*3.21.6*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.6/
    rm -rf ../*proto*3.21.6*.* ../python*-protobuf*4.21.6*.*

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch
See protocolbuffers#10403

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Oct 18, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.8.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.8-1.spec
    mv ../*protobuf*3.21.8*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.8/
    rm -rf ../*proto*3.21.8*.* ../python*-protobuf*4.21.7*.*

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch
See protocolbuffers#10403

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Oct 27, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.9.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.9-1.spec
    mv ../*protobuf*3.21.9*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.9/
    rm -rf ../*proto*3.21.9*.* ../python*-protobuf*4.21.9*.*

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch
See protocolbuffers#10403

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
@fmartinsons
Copy link

fmartinsons commented Nov 7, 2022

Hello there, I had the same issues using python protobuf (so no problem during compilation but undefined reference at runtime) version 3.11.4):

      File "/usr/lib/python3.8/site-packages/sigfox/protobuf/basestationsystem_pb2.py", line 6, in <module>
        from google.protobuf import descriptor as _descriptor
      File "/usr/lib/python3.8/site-packages/google/protobuf/descriptor.py", line 47, in <module>
        from google.protobuf.pyext import _message
    ImportError: /usr/lib/python3.8/site-packages/google/protobuf/pyext/_message.cpython-38-x86_64-linux-gnu.so: undefined symbol: descriptor_table_google_2fprotobuf_2fdescriptor_2eproto

I corrected that thanks to @LourensVeen suggestion but I would like to know the real fix (or at least the merge of the modified *.map).
Is somebody has news about this subject ?

@LourensVeen
Copy link
Contributor

I figured I'd try to make a pull request with the map file update, but apparently the real fix was to remove autotools and require Bazel instead (#10132). I don't know if Bazel ignores the map files like CMake does, but if anyone can reproduce this while building with Bazel then I'll try to submit a PR for the map files update anyway. I've removed gRPC/protobuf from my application, so I can't justify doing a bunch of testing with Bazel myself, sorry.

@fmartinsons
Copy link

I use yocto build system to cross compile protobuf so I'm dependent on them. Their master branch contains the patch you mention for compiling protobuf, see there

They mention issue #6113 like you did. So it seems the patch on map files would be interesting to be merge,isn't it ?

@LourensVeen
Copy link
Contributor

That got me confused for a bit, since yocto seems to be using CMake to build it, but then I discovered that #6113 has been fixed now, so that CMake now does use the map files and yocto needs to apply the patch to get things to work. Sounds like it's worth a PR then, I'll try to make one.

hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Dec 8, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.10.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.10-1.spec
    mv ../*protobuf*3.21.10*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.10/
    rm -rf ../*proto*3.21.10*.* ../python*-protobuf*4.21.10*.*

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch
See protocolbuffers#10403

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Dec 8, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.11.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.11-1.spec
    mv ../*protobuf*3.21.11*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.11/
    rm -rf ../*proto*3.21.11*.* ../python*-protobuf*4.21.11*.*

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch
See protocolbuffers#10403

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue Dec 15, 2022
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.12.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.12-1.spec
    mv ../*protobuf*3.21.12*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.12/
    rm -rf ../*proto*3.21.12*.* ../python*-protobuf*4.21.12*.*

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch
See protocolbuffers#10403

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
copybara-service bot pushed a commit that referenced this issue Feb 28, 2023
On some linkers, the ABI definitions in src/libprotoc.map and friends do not match all symbols that need to be exported. This causes a linker error when trying to use the resulting shared object library: `undefined reference to 'scc_info_FileDescriptorProto_google_2fprotobuf_2fdescriptor_2eproto'`

Quite a few people seem to be affected by this, see #5144 for discussion. It seems that yocto now applies this patch itself, but that doesn't help people building in other places (I encountered this on some HPC machines), so it would probably be good to apply it upstream as well.

Closes #11032

COPYBARA_INTEGRATE_REVIEW=#11032 from LourensVeen:issue-5144-linker-maps 3039f93
PiperOrigin-RevId: 512810858
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue May 5, 2023
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.10.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.10-1.spec
    mv ../*protobuf*3.21.10*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.10/
    rm -rf ../*proto*3.21.10*.* ../python*-protobuf*4.21.10*.*

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch
See protocolbuffers#10403

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue May 5, 2023
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.11.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.11-1.spec
    mv ../*protobuf*3.21.11*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.11/
    rm -rf ../*proto*3.21.11*.* ../python*-protobuf*4.21.11*.*

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch
See protocolbuffers#10403

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/protocolbuffers-protobuf that referenced this issue May 5, 2023
    git clean -xdf
    git submodule sync --recursive
    git submodule update --init --recursive
    tar zcvf ../protobuf_3.21.12.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp protobuf.spec ../protobuf_3.21.12-1.spec
    mv ../*protobuf*3.21.12*.{gz,xz,spec,dsc} /osc/home\:alvistack/protocolbuffers-protobuf-3.21.12/
    rm -rf ../*proto*3.21.12*.* ../python*-protobuf*4.21.12*.*

See protocolbuffers#5144 (comment)
See https://build.opensuse.org/package/view_file/openSUSE:Factory/protobuf/10355.patch
See protocolbuffers#10403

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants