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

clang-16 is useless and break the sparse build #160

Open
avolkov-1221 opened this issue Aug 24, 2023 · 0 comments
Open

clang-16 is useless and break the sparse build #160

avolkov-1221 opened this issue Aug 24, 2023 · 0 comments

Comments

@avolkov-1221
Copy link

Hello,

The latest Docker images were switched to clang-16 installation, however this clang is not used by the system as Ubuntu's clang-15 is installed by default by mono dependencies, so clang-16 is probably nothing but a waste of space.

Also, if the default clang-15 is replaced to clang-16 by the update-alternative script, then the sparse-llvm build will be broken as no one has updated it for years. Part of sparse-llvm broken build log is below.

So I suggest to switch back to Ubuntu's clang-15 usage, of fix sparse-llvm and forcing clang-16 as as the only clang of the system.

Broken sparse-llvm:

......
  CC      version.o
sparse-llvm.c: In function ‘get_sym_value’:
sparse-llvm.c:305:34: warning: implicit declaration of function ‘LLVMConstGEP’; did you mean ‘LLVMConstGEP2’? [-Wimplicit-function-declaration]
  305 |                         result = LLVMConstGEP(data, indices, ARRAY_SIZE(indices));
      |                                  ^~~~~~~~~~~~
      |                                  LLVMConstGEP2
sparse-llvm.c:305:32: warning: assignment to ‘LLVMValueRef’ {aka ‘struct LLVMOpaqueValue *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  305 |                         result = LLVMConstGEP(data, indices, ARRAY_SIZE(indices));
      |                                ^
sparse-llvm.c: In function ‘calc_gep’:
sparse-llvm.c:488:16: warning: implicit declaration of function ‘LLVMBuildInBoundsGEP’; did you mean ‘LLVMBuildInBoundsGEP2’? [-Wimplicit-function-declaration]
  488 |         addr = LLVMBuildInBoundsGEP(builder, base, &off, 1, name);
      |                ^~~~~~~~~~~~~~~~~~~~
      |                LLVMBuildInBoundsGEP2
sparse-llvm.c:488:14: warning: assignment to ‘LLVMValueRef’ {aka ‘struct LLVMOpaqueValue *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  488 |         addr = LLVMBuildInBoundsGEP(builder, base, &off, 1, name);
      |              ^
sparse-llvm.c: In function ‘output_op_load’:
sparse-llvm.c:714:18: warning: implicit declaration of function ‘LLVMBuildLoad’; did you mean ‘LLVMBuildLoad2’? [-Wimplicit-function-declaration]
  714 |         target = LLVMBuildLoad(fn->builder, addr, name);
      |                  ^~~~~~~~~~~~~
      |                  LLVMBuildLoad2
sparse-llvm.c:714:16: warning: assignment to ‘LLVMValueRef’ {aka ‘struct LLVMOpaqueValue *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  714 |         target = LLVMBuildLoad(fn->builder, addr, name);
      |                ^
sparse-llvm.c: In function ‘output_op_call’:
sparse-llvm.c:822:18: warning: implicit declaration of function ‘LLVMBuildCall’; did you mean ‘LLVMBuildCall2’? [-Wimplicit-function-declaration]
  822 |         target = LLVMBuildCall(fn->builder, func, args, n_arg, name);
      |                  ^~~~~~~~~~~~~
      |                  LLVMBuildCall2
sparse-llvm.c:822:16: warning: assignment to ‘LLVMValueRef’ {aka ‘struct LLVMOpaqueValue *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  822 |         target = LLVMBuildCall(fn->builder, func, args, n_arg, name);
      |                ^
  AR      libsparse.a
  LD      compile
  LD      ctags
  LD      example
  LD      graph
  LD      obfuscate
  LD      sparse
  LD      test-dissect
  LD      test-lexing
  LD      test-linearize
  LD      test-parsing
  LD      test-show-type
  LD      test-unssa
  LD      c2xml
  LD      sparse-llvm
/usr/bin/ld: sparse-llvm.o: in function `get_sym_value':
.../sparse/sparse/sparse-llvm.c:305: undefined reference to `LLVMConstGEP'
/usr/bin/ld: sparse-llvm.o: in function `calc_gep':
.../sparse/sparse/sparse-llvm.c:488: undefined reference to `LLVMBuildInBoundsGEP'
/usr/bin/ld: sparse-llvm.o: in function `output_op_load':
.../sparse/sparse/sparse-llvm.c:714: undefined reference to `LLVMBuildLoad'
/usr/bin/ld: sparse-llvm.o: in function `output_op_call':
.../sparse/sparse/sparse-llvm.c:822: undefined reference to `LLVMBuildCall'
collect2: error: ld returned 1 exit status
make: *** [Makefile:250: sparse-llvm] Error 1
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

1 participant