FW: Successfully build libstdc++ for wasm32-wasi

unlvsur unlvsur unlvsur@live.com
Wed Apr 28 12:30:07 GMT 2021


Hello clang and llvm devs. Can you enable -stdlib=libstdc++ for wasm32-wasi? I have successfully built libstdc++ with clang, targeting wasm32-wasi. Problem is clang does not support this for that target. Options like -nostdinc++ will end up conflict with -lc++abi since clang always adds -lc++abi to the compilation command.

I know GCC itself does not support webassembly, but Libstdc++ can be built.

Thank you

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: unlvsur unlvsur<mailto:unlvsur@live.com>
Sent: Wednesday, April 28, 2021 08:21
To: Jonathan Wakely<mailto:jwakely.gcc@gmail.com>
Cc: unlvsur unlvsur via Libstdc++<mailto:libstdc++@gcc.gnu.org>
Subject: Re: Successfully build libstdc++ for wasm32-wasi

Probably We need to tell clang to support -stdlib=libstdc++ for wasm? And nathan is able to modify the clang source code directly
Get Outlook for Android<https://aka.ms/AAb9ysg>


From: Jonathan Wakely <jwakely.gcc@gmail.com>
Sent: Wednesday, April 28, 2021 4:52:55 AM
To: unlvsur unlvsur <unlvsur@live.com>
Cc: unlvsur unlvsur via Libstdc++ <libstdc++@gcc.gnu.org>
Subject: Re: Successfully build libstdc++ for wasm32-wasi


On Wed, 28 Apr 2021, 04:59 unlvsur unlvsur via Libstdc++, <libstdc++@gcc.gnu.org<mailto:libstdc%2B%2B@gcc.gnu.org>> wrote:
The issue is that clang front-end does not support -stdlib=libstdc++ for wasm32-wasi. It always adds -lc++abi toggle. Is that possible to disable this and use -lsupc++?


That seems like a question about using clang, so off topic here, but I would try -nostdlib -lsupc++



-------------- next part --------------
A non-text attachment was scrubbed...
Name: 65B15BA9A5594C71B0CA9E75307E1408.png
Type: image/png
Size: 159 bytes
Desc: 65B15BA9A5594C71B0CA9E75307E1408.png
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20210428/08291d56/attachment.png>


More information about the Libstdc++ mailing list