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
gollvm: libffi and GNU as bugs #42049
Comments
|
|
@thanm , @cherrymui : you can find my compressed build folder in https://drive.google.com/file/d/1kLsAR8cXKOX0nBqNy3DExNCz4maK-coU/view?usp=sharing |
I was able to compile libgmp and install it locally. |
@advancedwebdeveloper randomly mentioning folks as you did above is not helpful, just generates noise and confusion. As of 33d28e1b8583e3e0455d80bc5bec05476257c39c gollvm is no longer invoking the external assembler by default, so the version of "as" should not be relevant. I would suggest updating your git clients and redoing the build from a clean slate. |
What exactly are you proposing? |
And why did you decide that I have an outdated Git client?
|
Not the version of git itself, the revision checked out in each repo. Example: $ cd |
Here is what I see:
|
OK, try rerunning the compile command for that file with -E (and with -MT/-MD etc stripped out). This will show the preprocessed source. Ex:
|
Here you go:
|
Well, I'm stumped then. What you are telling me is that when you rerun the offending command by hand, it works. But when ninja runs it, you get the
errors. I don't have an explanation for that. |
OK, I should have picked up on this before, but the command that's being used to assemble the libffi files includes these options mixed in with all the others: -x c That tells clang that in spite of the ".S" extension on the file, the input language is C, not assembly. So the next question is how that "-x c" got in there. I looked for it in the LLVM sources-- don't see it anywhere there. How exactly are you running cmake, e.g. exact cmake invocation? |
I have pulled the source tarballs of all four dependencies - and configured/built/installed those, in external/separate folders. It still does not explain how to avoid locking Ninja's (or make's) targets - I can't compile/link the rest, cause of this (and I can't re-use pre-installed decencies - headers and libs are available from system folders). As for your question: I didn't experiment with libc++, this time - so I tried such configurations:
Maybe -DLLVM_TARGETS_TO_BUILD=X86 triggers something - but it was just to limit against non-desired back-ends. Let me know what else should I check. |
You might try adding -DCMAKE_ASM_COMPILER=clang to your cmake invocation. Shot in the dark, but it might help. -DLLVM_TARGETS_TO_BUILD=X86 should be fine, I use that routinely. |
@thanm ,
for
|
Here is my compressed build folder |
Please add "-G ninja" when invoking cmake. Building with "make" is not something I've ever tried-- please use ninja instead. |
This corresponds to what I got with
|
OK, try running cmake with the additional "--trace-expand" option. This will generate huge amounts of trace output, but once you have that you can sift through it and look for the spot where the "-x c" is being introduced. |
My log Log is too big for any gist or download threw Github's UI. |
What should be the next step? |
OK, I in inspected the cmake error log -- nothing there. That suggests that the bad behavior is being injected by cmake itself. On that theory I found this commit: which looks very suspicious. What version of cmake are you runnning? Is it 3.18 or beyond by any chance? I will try building a tip version of cmake to see if I can reproduce. |
Change https://golang.org/cl/264633 mentions this issue: |
It does indeed reproduce. I am sending a fix. |
Just a note that I fixed the libbacktrace warnings reported above. These are not causing any trouble, but it seemed worth fixing them. |
https://golang.org/cl/264633 has been submitted. @advancedwebdeveloper thanks for your patience. This should be fixed now, let me know if not. |
|
@thanm, and what is the problem with upgrading ../llvm-project/llvm/tools/CMakeLists.txt ? |
I have compiled gollvm - so this issue could be closed. But I have another issue, now:
and the fact that Golang 1.15.3 was released - I am getting
.
|
We haven't yet updated the gofrontend code to 1.15.3. |
But what released then? |
@lattner , could you elaborate regarding this? |
Please, please, please, do not CC random people to ask questions about GoLLVM. Please be respectful of people's time. The main Go compiler, the gc compiler, had a 1.15.3 release. That release has not yet been incorporated into the gofrontend code used by GoLLVM. |
OK, that means that there is no issue. |
This is expected behavior. When LLVM folks release version X, they then bump the major version of LLVM in trunk to N+1. See for example https://github.com/llvm/llvm-project/blob/7ab7b979d29e/llvm/CMakeLists.txt |
While building gollvm, using the latest version of Clang and libc++, I got such a problem:
428/1925] Building CXX object tools/gollvm/passes/CMakeFiles/LLVMCppGoPasses.dir/GoStatepoints.cpp.o
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/passes/GoStatepoints.cpp:2160:11: warning: 'insertEdge' is deprecated: Use applyUpdates() instead. [-Wdeprecated-declarations]
DTU.insertEdge(Old, PadBB);
^
/home/oceanfish81/workarea/llvm-project/llvm/include/llvm/Analysis/DomTreeUpdater.h:159:3: note: 'insertEdge' has been explicitly marked deprecated here
LLVM_ATTRIBUTE_DEPRECATED(void insertEdge(BasicBlock *From, BasicBlock *To),
^
/home/oceanfish81/workarea/llvm-project/llvm/include/llvm/Support/Compiler.h:319:23: note: expanded from macro 'LLVM_ATTRIBUTE_DEPRECATED'
decl attribute((deprecated(message)))
^
1 warning generated.
[438/1925] Building CXX object tools/gollvm/passes/CMakeFiles/LLVMCppGoPasses.dir/Util.cpp.o
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/passes/Util.cpp:74:34: warning: 'getNumElements' is deprecated: Calling this function via a base VectorType is deprecated. Either call getElementCount() and handle the case where Scalable is true or cast to FixedVectorType. [-Wdeprecated-declarations]
for (unsigned i = 0, n = VT->getNumElements(); i < n; ++i) {
^
/home/oceanfish81/workarea/llvm-project/llvm/include/llvm/IR/DerivedTypes.h:426:3: note: 'getNumElements' has been explicitly marked deprecated here
LLVM_ATTRIBUTE_DEPRECATED(
^
/home/oceanfish81/workarea/llvm-project/llvm/include/llvm/Support/Compiler.h:319:23: note: expanded from macro 'LLVM_ATTRIBUTE_DEPRECATED'
decl attribute((deprecated(message)))
^
1 warning generated.
[442/1925] Building C object tools/gollvm/libgo/CMakeFiles/libffi_nonpiclib.dir/libffi/src/x86/ffiw64.c.o
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libffi/src/x86/ffiw64.c:79:5: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
case FFI_TYPE_STRUCT:
^
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libffi/src/x86/ffiw64.c:79:5: note: insert 'attribute((fallthrough));' to silence this warning
case FFI_TYPE_STRUCT:
^
attribute((fallthrough));
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libffi/src/x86/ffiw64.c:79:5: note: insert 'break;' to avoid fall-through
case FFI_TYPE_STRUCT:
^
break;
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libffi/src/x86/ffiw64.c:243:18: warning: assigning to 'void *' from 'void (void)' converts between void pointer and function pointer [-Wpedantic]
closure->tramp = ffi_go_closure_win64;
^ ~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
[444/1925] Building C object tools/gollvm/libgo/CMakeFiles/libbacktrace_piclib.dir/libbacktrace/elf.c.o
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libbacktrace/elf.c:2085:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
case 5:
^
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libbacktrace/elf.c:2085:4: note: insert 'attribute((fallthrough));' to silence this warning
case 5:
^
attribute((fallthrough));
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libbacktrace/elf.c:2085:4: note: insert 'break;' to avoid fall-through
case 5:
^
break;
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libbacktrace/elf.c:2088:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
case 4:
^
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libbacktrace/elf.c:2088:4: note: insert 'attribute((fallthrough));' to silence this warning
case 4:
^
attribute((fallthrough));
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libbacktrace/elf.c:2088:4: note: insert 'break;' to avoid fall-through
case 4:
^
break;
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libbacktrace/elf.c:2119:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
case 9:
^
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libbacktrace/elf.c:2119:4: note: insert 'attribute((fallthrough));' to silence this warning
case 9:
^
attribute((fallthrough));
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libbacktrace/elf.c:2119:4: note: insert 'break;' to avoid fall-through
case 9:
^
break;
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libbacktrace/elf.c:2122:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
case 8:
^
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libbacktrace/elf.c:2122:4: note: insert 'attribute((fallthrough));' to silence this warning
case 8:
^
attribute((fallthrough));
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libbacktrace/elf.c:2122:4: note: insert 'break;' to avoid fall-through
case 8:
^
break;
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libbacktrace/elf.c:2125:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
case 7:
^
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libbacktrace/elf.c:2125:4: note: insert 'attribute((fallthrough));' to silence this warning
case 7:
^
attribute((fallthrough));
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libbacktrace/elf.c:2125:4: note: insert 'break;' to avoid fall-through
case 7:
^
break;
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libbacktrace/elf.c:2128:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
case 6:
^
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libbacktrace/elf.c:2128:4: note: insert 'attribute((fallthrough));' to silence this warning
case 6:
^
attribute((fallthrough));
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libbacktrace/elf.c:2128:4: note: insert 'break;' to avoid fall-through
case 6:
^
break;
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libbacktrace/elf.c:2131:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
case 5:
^
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libbacktrace/elf.c:2131:4: note: insert 'attribute((fallthrough));' to silence this warning
case 5:
^
attribute((fallthrough));
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libbacktrace/elf.c:2131:4: note: insert 'break;' to avoid fall-through
case 5:
^
break;
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libbacktrace/elf.c:2134:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
case 4:
^
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libbacktrace/elf.c:2134:4: note: insert 'attribute((fallthrough));' to silence this warning
case 4:
^
attribute((fallthrough));
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libbacktrace/elf.c:2134:4: note: insert 'break;' to avoid fall-through
case 4:
^
break;
8 warnings generated.
[445/1925] Building C object tools/gollvm/libgo/CMakeFiles/libffi_piclib.dir/libffi/src/java_raw_api.c.o
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libffi/src/java_raw_api.c:328:46: warning: 'ffi_java_raw_size' is deprecated [-Wdeprecated-declarations]
ffi_java_raw raw = (ffi_java_raw)alloca (ffi_java_raw_size (cif));
^
tools/gollvm/libgo/ffi.h:299:56: note: 'ffi_java_raw_size' has been explicitly marked deprecated here
size_t ffi_java_raw_size (ffi_cif *cif) attribute((deprecated));
^
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libffi/src/java_raw_api.c:331:3: warning: 'ffi_java_ptrarray_to_raw' is deprecated [-Wdeprecated-declarations]
ffi_java_ptrarray_to_raw (cif, avalue, raw);
^
tools/gollvm/libgo/ffi.h:295:93: note: 'ffi_java_ptrarray_to_raw' has been explicitly marked deprecated here
void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw) attribute((deprecated));
^
2 warnings generated.
[446/1925] Building C object tools/gollvm/libgo/CMakeFiles/libffi_piclib.dir/libffi/src/x86/ffiw64.c.o
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libffi/src/x86/ffiw64.c:79:5: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
case FFI_TYPE_STRUCT:
^
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libffi/src/x86/ffiw64.c:79:5: note: insert 'attribute((fallthrough));' to silence this warning
case FFI_TYPE_STRUCT:
^
attribute((fallthrough));
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libffi/src/x86/ffiw64.c:79:5: note: insert 'break;' to avoid fall-through
case FFI_TYPE_STRUCT:
^
break;
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libffi/src/x86/ffiw64.c:243:18: warning: assigning to 'void *' from 'void (void)' converts between void pointer and function pointer [-Wpedantic]
closure->tramp = ffi_go_closure_win64;
^ ~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
[448/1925] Building C object tools/gollvm/libgo/CMakeFiles/libffi_piclib.dir/libffi/src/closures.c.o
In file included from /home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libffi/src/closures.c:530:
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libffi/src/dlmalloc.c:2937:33: warning: arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension [-Wnull-pointer-arithmetic]
used = fp - (m->topsize + TOP_FOOT_SIZE);
^~~~~~~~~~~~~
/home/oceanfish81/workarea/llvm-project/llvm/tools/gollvm/libgo/libffi/src/dlmalloc.c:2193:17: note: expanded from macro 'TOP_FOOT_SIZE'
(align_offset(chunk2mem(0))+pad_request(sizeof(struct malloc_segment))+MIN_CHUNK_SIZE)
The text was updated successfully, but these errors were encountered: