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

__atomic_store error: incompatible integer to pointer conversion #13

Open
mingodad opened this issue Mar 15, 2023 · 2 comments
Open

__atomic_store error: incompatible integer to pointer conversion #13

mingodad opened this issue Mar 15, 2023 · 2 comments

Comments

@mingodad
Copy link

When trying to build cheerp on Ubuntu 18.04 with:

Makefile:151: recipe for target 'obj/crt/cheerp/crt1.o' failed
make: *** [obj/crt/cheerp/crt1.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from ../src/aio/lio_listio.c:5:
In file included from ../src/internal/pthread_impl.h:11:
In file included from ../src/internal/atomic.h:6:
../arch/cheerp/atomic_arch.h:67:20: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'volatile int *'; take the address with & [-Wint-conversion]
        __atomic_store(p, x, __ATOMIC_SEQ_CST);
                          ^
                          &
1 error generated.
1 error generated.
@mingodad
Copy link
Author

When adding & to x -> __atomic_store(p, &x, __ATOMIC_SEQ_CST);:

cheerp/bin/clang -target cheerp-wasm -I cheerp/lib/clang/15.0.0/include -std=c99 -nostdinc -frounding-math -Wa,--noexecstack -D_XOPEN_SOURCE=700 -I../arch/cheerp -I../arch/generic -Iobj/src/internal -I../src/include -I../src/internal -Iobj/include -I../include  -Os -pipe -fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections -w -Wno-pointer-to-int-cast -Werror=implicit-function-declaration -Werror=implicit-int -Werror=pointer-sign -Werror=pointer-arith -Werror=int-conversion -Werror=incompatible-pointer-types -Qunused-arguments -Waddress -Warray-bounds -Wchar-subscripts -Wduplicate-decl-specifier -Winit-self -Wreturn-type -Wsequence-point -Wstrict-aliasing -Wunused-function -Wunused-label -Wunused-variable  -fno-stack-protector -c -o obj/src/env/__init_tls.o ../src/env/__init_tls.c
../src/env/__init_tls.c:22:43: error: incompatible pointer to integer conversion passing 'volatile int *' to parameter of type 'long' [-Wint-conversion]
        td->tid = __syscall(SYS_set_tid_address, &__thread_list_lock);
                                                 ^~~~~~~~~~~~~~~~~~~
../src/internal/syscall.h:55:49: note: expanded from macro '__syscall'
#define __syscall(...) __SYSCALL_DISP(__syscall,__VA_ARGS__)
                                                ^~~~~~~~~~~
../src/internal/syscall.h:53:80: note: expanded from macro '__SYSCALL_DISP'
#define __SYSCALL_DISP(b,...) __SYSCALL_CONCAT(b,__SYSCALL_NARGS(__VA_ARGS__))(__VA_ARGS__)
                                                                               ^~~~~~~~~~~
../src/internal/syscall.h:32:27: note: expanded from macro '__syscall1'
#define __syscall1(n,a) n(a)
                          ^
../arch/cheerp/syscall_arch.h:262:37: note: passing argument to parameter 'a1' here
long __syscall_set_tid_address(long a1,...);
                                    ^
1 error generated.
Makefile:151: recipe for target 'obj/src/env/__init_tls.o' failed
make: *** [obj/src/env/__init_tls.o] Error 1

Notice this cheerp/lib/clang/15.0.0/include but https://github.com/leaningtech/cheerp-meta/releases/download/cheerp-3.0/cheerp-llvm-clang-3.0.tar.gz have clang16.

@yuri91
Copy link
Member

yuri91 commented Mar 15, 2023

Hi @mingodad,

The build instructions of musl on our docs page seem outdated.

Try with the instructions found in README.md in this repo. Those should work.

I will update the docs, thanks for reporting this!

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

No branches or pull requests

2 participants