TL;DR
The difference between using cc and g++:
$ cc -shared -L/usr/lib -L/usr/local/lib -fstack-protector -o blib/arch/auto/CSS/Sass/Sass.so -Wl,-lstdc++ libsass/src/ast.o libsass/src/base64vlq.o libsass/src/bind.o libsass/src/cencode.o libsass/src/check_nesting.o libsass/src/color_maps.o libsass/src/constants.o libsass/src/context.o libsass/src/cssize.o libsass/src/emitter.o libsass/src/environment.o libsass/src/error_handling.o libsass/src/eval.o libsass/src/expand.o libsass/src/extend.o libsass/src/file.o libsass/src/functions.o libsass/src/inspect.o libsass/src/json.o libsass/src/lexer.o libsass/src/listize.o libsass/src/memory_manager.o libsass/src/node.o libsass/src/output.o libsass/src/parser.o libsass/src/plugins.o libsass/src/position.o libsass/src/prelexer.o libsass/src/remove_placeholders.o libsass/src/sass.o libsass/src/sass2scss.o libsass/src/sass_context.o libsass/src/sass_functions.o libsass/src/sass_util.o libsass/src/sass_values.o libsass/src/source_map.o libsass/src/to_c.o libsass/src/to_value.o libsass/src/units.o libsass/src/utf8_string.o libsass/src/util.o libsass/src/values.o Sass.o
RG Docker root@rg:~/.cpanm/work/1465739293.982/CSS-Sass-3.3.4 $ ldd
/root/.cpanm/work/1465739293.982/CSS-Sass-3.3.4/blib/arch/auto/CSS/Sass/Sass.so
linux-vdso.so.1 => (0x00007ffe928ca000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ff6a9264000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff6a8e9f000)
/lib64/ld-linux-x86-64.so.2 (0x000055c6a3035000)
RG Docker root@rg:~/.cpanm/work/1465739293.982/CSS-Sass-3.3.4 $ c++ -shared -L/usr/lib -L/usr/local/lib -fstack-protector -o blib/arch/auto/CSS/Sass/Sass.so -Wl,-lstdc++ libsass/src/ast.o libsass/src/base64vlq.o libsass/src/bind.o libsass/src/cencode.o libsass/src/check_nesting.o libsass/src/color_maps.o libsass/src/constants.o libsass/src/context.o libsass/src/cssize.o libsass/src/emitter.o libsass/src/environment.o libsass/src/error_handling.o libsass/src/eval.o libsass/src/expand.o libsass/src/extend.o libsass/src/file.o libsass/src/functions.o libsass/src/inspect.o libsass/src/json.o libsass/src/lexer.o libsass/src/listize.o libsass/src/memory_manager.o libsass/src/node.o libsass/src/output.o libsass/src/parser.o libsass/src/plugins.o libsass/src/position.o libsass/src/prelexer.o libsass/src/remove_placeholders.o libsass/src/sass.o libsass/src/sass2scss.o libsass/src/sass_context.o libsass/src/sass_functions.o libsass/src/sass_util.o libsass/src/sass_values.o libsass/src/source_map.o libsass/src/to_c.o libsass/src/to_value.o libsass/src/units.o libsass/src/utf8_string.o libsass/src/util.o libsass/src/values.o Sass.o
RG Docker root@rg:~/.cpanm/work/1465739293.982/CSS-Sass-3.3.4 $ ldd /root/.cpanm/work/1465739293.982/CSS-Sass-3.3.4/blib/arch/auto/CSS/Sass/Sass.so linux-vdso.so.1 => (0x00007ffd5f39e000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f854353d000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f8543237000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f8543020000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8542c5b000)
/lib64/ld-linux-x86-64.so.2 (0x0000563b62aaa000)
It might seem that the main error is this:
From:
https://wiki.ubuntu.com/OneiricOcelot/ReleaseNotes?action=show&redirect=OneiricOcelot%2FTechnicalOverview#GCC_4.6_Toolchain
-Wl,--as-needed with this option the linker will only add a DT_NEEDED tag for a dynamic library mentioned on the command line if if the library is actually used. A common build error with this option enabled is seen when libraries appear on the command line before objects that reference them. More information and recipes how to fix such build errors can be found at NattyNarwhal/ToolchainTransition and the corresponding Debian page.
So perhaps changing the order here might be what is needed:
RG Docker root@rg:~/.cpanm/work/1465739293.982/CSS-Sass-3.3.4 $ cc -shared -L/usr/local/lib -fstack-protector -o blib/arch/auto/CSS/Sass/Sass.so libsass/src/ast.o libsass/src/base64vlq.o libsass/src/bind.o libsass/src/cencode.o libsass/src/check_nesting.o libsass/src/color_maps.o libsass/src/constants.o libsass/src/context.o libsass/src/cssize.o libsass/src/emitter.o libsass/src/environment.o libsass/src/error_handling.o libsass/src/eval.o libsass/src/expand.o libsass/src/extend.o libsass/src/file.o libsass/src/functions.o libsass/src/inspect.o libsass/src/json.o libsass/src/lexer.o libsass/src/listize.o libsass/src/memory_manager.o libsass/src/node.o libsass/src/output.o libsass/src/parser.o libsass/src/plugins.o libsass/src/position.o libsass/src/prelexer.o libsass/src/remove_placeholders.o libsass/src/sass.o libsass/src/sass2scss.o libsass/src/sass_context.o libsass/src/sass_functions.o libsass/src/sass_util.o libsass/src/sass_values.o libsass/src/source_map.o libsass/src/to_c.o libsass/src/to_value.o libsass/src/units.o libsass/src/utf8_string.o libsass/src/util.o libsass/src/values.o Sass.o -lstdc++
RG Docker root@rg:~/.cpanm/work/1465739293.982/CSS-Sass-3.3.4 $ ldd /root/.cpanm/work/1465739293.982/CSS-Sass-3.3.4/blib/arch/auto/CSS/Sass/Sass.so linux-vdso.so.1 => (0x00007fffb8772000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f7abcd72000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f7abcb5c000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7abc796000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7abc490000)
/lib64/ld-linux-x86-64.so.2 (0x0000564958d01000)
I am however not sure how to accomplish that, and perhaps a newer version of Extutils::Something is needed.
Could you help me out? Thanks.