externis icon indicating copy to clipboard operation
externis copied to clipboard

`undefined symbol: _Z14decl_as_stringP9tree_nodei`

Open cmcquinn opened this issue 2 years ago • 4 comments

I am getting cc1: error: cannot load plugin /usr/lib/gcc/x86_64-linux-gnu/11/plugin/externis.so: /usr/lib/gcc/x86_64-linux-gnu/11/plugin/externis.so: undefined symbol: _Z14decl_as_stringP9tree_nodei after building with gcc11 on ubuntu 22.04.

cmcquinn avatar Jan 26 '24 00:01 cmcquinn

This is weird. Did you compile the plugin using the same compiler that you try to use it with? Could you post the output of ldd /usr/lib/gcc/x86_64-linux-gnu/11/plugin/externis.so?

royjacobson avatar Jan 26 '24 14:01 royjacobson

ldd /usr/lib/gcc/x86_64-linux-gnu/11/plugin/externis.so
        linux-vdso.so.1 (0x00007ffceed38000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f3a29db3000)
        libgcc_s.so.1 => /usr/lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f3a29d93000)
        libc.so.6 => /usr/lib/x86_64-linux-gnu/libc.so.6 (0x00007f3a29b6b000)
        libm.so.6 => /usr/lib/x86_64-linux-gnu/libm.so.6 (0x00007f3a29a84000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f3a2a042000)

I am building and using externis with gcc 11.

cmcquinn avatar Jan 26 '24 17:01 cmcquinn

Ok, I think I understand the issue -

root@d42820f69d52:/lib# grep _Z14decl_as_stringP9tree_nodei -R
grep: gcc/x86_64-linux-gnu/11/plugin/externis.so: binary file matches
grep: gcc/x86_64-linux-gnu/11/cc1plus: binary file matches

It seems that the symbol is only available as a C++ compiler plugin and not as a C compiler plugin. I'm not sure how to fix this, though. Could you ask in the GCC mailing list about this? In the meantime I can only suggest the workaround of not using the plugin when compiling for C.

royjacobson avatar Jan 31 '24 15:01 royjacobson