Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

c++ function names #18

Open
pa-m opened this issue Dec 27, 2018 · 1 comment
Open

c++ function names #18

pa-m opened this issue Dec 27, 2018 · 1 comment

Comments

@pa-m
Copy link

pa-m commented Dec 27, 2018

Hi,
I tried c2goasm on ubuntu18.04 with go 1.11 and encountered 2 little issues:

IMHO assemble.sh should contain clang and not c++.
using c++ (set for me to clang++ via update-alternatives) produces one underscore in front of function identifiers instead of two as expected by c2goasm.

Here's my clang++ version
clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

The 2nd pb is in the MultiplyAandAdd example
MultiplyAndAdd didn't work until I replaced _mm256_load_ps with _mm256_loadu_ps, probably because args are not 32-byte aligned.

Best regards

@leiysky
Copy link

leiysky commented Jun 13, 2021

C++ compilers will mangle every function symbol by default.

You can use extern "C" to enforce compiler produce C ABI for you.

Here's an example:

extern "C" void Foo() {}
// Will produce ABI like:
// 0000000000000000 T Foo

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants