You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ubuntu 22.04.5 Jammy
I'm trying to convert this cpp library to c: https://github.com/vinniefalco/DSPFilters , specifically ./shared/DSPFilters . I cloned https://github.com/llvm/llvm-project (llvmorg-19.1.1 / d401987fe349a87c53fe25829215b080b70c0c1a), built it (I think according to your instructions, rather than the llvm ones - it did build though), cloned llvm-cbe into the llvm/projects folder and built it as instructed. All fine and good. I also built the whole llvm-project directory, because it seemed like I needed llvm-link, but I'm not sure if that ended up being true. I've cloned DSPFilters (master / acc49170e79a94fcb9c04b8a2116e9f8dffd1c7d), cd shared/DSPFilters/source, and do the following:
user@user-Latitude-7400:~/clones/DSPFilters/shared/DSPFilters/source$ ll
total 160
drwxrwxr-x 2 user user 4096 Dec 6 13:07 ./
drwxrwxr-x 7 user user 4096 Nov 27 17:17 ../
-rw-rw-r-- 1 user user 6482 Nov 27 13:09 Bessel.cpp
-rw-rw-r-- 1 user user 6096 Nov 27 13:09 Biquad.cpp
-rw-rw-r-- 1 user user 6187 Nov 27 13:27 Butterworth.cpp
-rw-rw-r-- 1 user user 3708 Nov 27 13:09 Cascade.cpp
-rw-rw-r-- 1 user user 8336 Nov 27 13:09 ChebyshevI.cpp
-rw-rw-r-- 1 user user 8419 Nov 27 13:09 ChebyshevII.cpp
-rw-rw-r-- 1 user user 2316 Nov 27 13:09 Custom.cpp
-rw-rw-r-- 1 user user 1731 Nov 27 13:09 Design.cpp
-rw-rw-r-- 1 user user 18619 Nov 27 13:09 Documentation.cpp
-rw-rw-r-- 1 user user 10102 Nov 27 13:09 Elliptic.cpp
-rw-rw-r-- 1 user user 3123 Nov 27 13:09 Filter.cpp
-rw-rw-r-- 1 user user 8429 Nov 27 13:09 Legendre.cpp
-rw-rw-r-- 1 user user 9976 Nov 27 13:09 Param.cpp
-rw-rw-r-- 1 user user 9399 Nov 27 13:09 PoleFilter.cpp
-rw-rw-r-- 1 user user 6698 Nov 27 13:09 RBJ.cpp
-rw-rw-r-- 1 user user 4798 Nov 27 13:09 RootFinder.cpp
-rw-rw-r-- 1 user user 1814 Nov 27 13:09 State.cpp
user@user-Latitude-7400:~/clones/DSPFilters/shared/DSPFilters/source$ ~/clones/llvm-project/build/bin/clang-19 -I ../include/ -S -emit-llvm -g *.cpp
user@user-Latitude-7400:~/clones/DSPFilters/shared/DSPFilters/source$ ll
total 5288
drwxrwxr-x 2 user user 4096 Dec 6 13:12 ./
drwxrwxr-x 7 user user 4096 Nov 27 17:17 ../
-rw-rw-r-- 1 user user 6482 Nov 27 13:09 Bessel.cpp
-rw-rw-r-- 1 user user 329349 Dec 6 13:09 Bessel.ll
-rw-rw-r-- 1 user user 6096 Nov 27 13:09 Biquad.cpp
-rw-rw-r-- 1 user user 542784 Dec 6 13:09 Biquad.ll
-rw-rw-r-- 1 user user 6187 Nov 27 13:27 Butterworth.cpp
-rw-rw-r-- 1 user user 305733 Dec 6 13:09 Butterworth.ll
-rw-rw-r-- 1 user user 3708 Nov 27 13:09 Cascade.cpp
-rw-rw-r-- 1 user user 472844 Dec 6 13:09 Cascade.ll
-rw-rw-r-- 1 user user 8336 Nov 27 13:09 ChebyshevI.cpp
-rw-rw-r-- 1 user user 8419 Nov 27 13:09 ChebyshevII.cpp
-rw-rw-r-- 1 user user 331603 Dec 6 13:10 ChebyshevII.ll
-rw-rw-r-- 1 user user 330401 Dec 6 13:10 ChebyshevI.ll
-rw-rw-r-- 1 user user 2316 Nov 27 13:09 Custom.cpp
-rw-rw-r-- 1 user user 174047 Dec 6 13:10 Custom.ll
-rw-rw-r-- 1 user user 1731 Nov 27 13:09 Design.cpp
-rw-rw-r-- 1 user user 120675 Dec 6 13:10 Design.ll
-rw-rw-r-- 1 user user 18619 Nov 27 13:09 Documentation.cpp
-rw-rw-r-- 1 user user 131728 Dec 6 13:10 Documentation.ll
-rw-rw-r-- 1 user user 10102 Nov 27 13:09 Elliptic.cpp
-rw-rw-r-- 1 user user 439354 Dec 6 13:11 Elliptic.ll
-rw-rw-r-- 1 user user 3123 Nov 27 13:09 Filter.cpp
-rw-rw-r-- 1 user user 201980 Dec 6 13:11 Filter.ll
-rw-rw-r-- 1 user user 8429 Nov 27 13:09 Legendre.cpp
-rw-rw-r-- 1 user user 388413 Dec 6 13:11 Legendre.ll
-rw-rw-r-- 1 user user 9976 Nov 27 13:09 Param.cpp
-rw-rw-r-- 1 user user 276367 Dec 6 13:11 Param.ll
-rw-rw-r-- 1 user user 9399 Nov 27 13:09 PoleFilter.cpp
-rw-rw-r-- 1 user user 479864 Dec 6 13:12 PoleFilter.ll
-rw-rw-r-- 1 user user 6698 Nov 27 13:09 RBJ.cpp
-rw-rw-r-- 1 user user 249046 Dec 6 13:12 RBJ.ll
-rw-rw-r-- 1 user user 4798 Nov 27 13:09 RootFinder.cpp
-rw-rw-r-- 1 user user 320693 Dec 6 13:12 RootFinder.ll
-rw-rw-r-- 1 user user 1814 Nov 27 13:09 State.cpp
-rw-rw-r-- 1 user user 120672 Dec 6 13:12 State.ll
user@user-Latitude-7400:~/clones/DSPFilters/shared/DSPFilters/source$ ~/clones/llvm-project/build/bin/llvm-cbe Bessel.ll
llvm-cbe: /home/user/clones/llvm-project/llvm/lib/IR/DataLayout.cpp:790: llvm::Align llvm::DataLayout::getAlignment(llvm::Type*, bool) const: Assertion `Ty->isSized() && "Cannot getTypeInfo() on a type that is unsized!"' failed.
#0 0x0000625cc678b2a0 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/user/clones/llvm-project/llvm/lib/Support/Unix/Signals.inc:723:22
#1 0x0000625cc678b6c1 PrintStackTraceSignalHandler(void*) /home/user/clones/llvm-project/llvm/lib/Support/Unix/Signals.inc:798:1
#2 0x0000625cc6788b11 llvm::sys::RunSignalHandlers() /home/user/clones/llvm-project/llvm/lib/Support/Signals.cpp:105:20
#3 0x0000625cc678ab38 SignalHandler(int) /home/user/clones/llvm-project/llvm/lib/Support/Unix/Signals.inc:413:1
#4 0x00007de27ae42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#5 0x00007de27ae969fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#6 0x00007de27ae969fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
#7 0x00007de27ae969fc pthread_kill ./nptl/pthread_kill.c:89:10
#8 0x00007de27ae42476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
#9 0x00007de27ae287f3 abort ./stdlib/abort.c:81:7
#10 0x00007de27ae2871b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#11 0x00007de27ae39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#12 0x0000625cc5cdc2d0 llvm::DataLayout::getAlignment(llvm::Type*, bool) const /home/user/clones/llvm-project/llvm/lib/IR/DataLayout.cpp:791:24
#13 0x0000625cc5cdc6dc llvm::DataLayout::getABITypeAlign(llvm::Type*) const /home/user/clones/llvm-project/llvm/lib/IR/DataLayout.cpp:867:1
#14 0x0000625cc5313202 llvm_cbe::CWriter::generateHeader(llvm::Module&) /home/user/clones/llvm-project/llvm/projects/llvm-cbe/lib/Target/CBackend/CBackend.cpp:2716:55
#15 0x0000625cc5311017 llvm_cbe::CWriter::doFinalization(llvm::Module&) /home/user/clones/llvm-project/llvm/projects/llvm-cbe/lib/Target/CBackend/CBackend.cpp:2398:50
#16 0x0000625cc5e5de4f llvm::FPPassManager::doFinalization(llvm::Module&) /home/user/clones/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1504:13
#17 0x0000625cc5e5e42f (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /home/user/clones/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1591:13
#18 0x0000625cc5e58ddb llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/user/clones/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:541:13
#19 0x0000625cc5e5ea89 llvm::legacy::PassManager::run(llvm::Module&) /home/user/clones/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1683:1
#20 0x0000625cc24444a7 compileModule(char**, llvm::LLVMContext&) /home/user/clones/llvm-project/llvm/projects/llvm-cbe/tools/llvm-cbe/llvm-cbe.cpp:352:12
#21 0x0000625cc244382f main /home/user/clones/llvm-project/llvm/projects/llvm-cbe/tools/llvm-cbe/llvm-cbe.cpp:204:35
#22 0x00007de27ae29d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#23 0x00007de27ae29e40 call_init ./csu/../csu/libc-start.c:128:20
#24 0x00007de27ae29e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#25 0x0000625cc2442f25 _start (/home/user/clones/llvm-project/build/bin/llvm-cbe+0xbc9f25)
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /home/user/clones/llvm-project/build/bin/llvm-cbe Bessel.ll
Aborted (core dumped)
Some of the files do work, like Custom.ll, but it seems like most of them fail in this way.
I tried merging them into one .ll first, but that didn't help:
Ubuntu 22.04.5 Jammy
I'm trying to convert this cpp library to c: https://github.com/vinniefalco/DSPFilters , specifically ./shared/DSPFilters . I cloned https://github.com/llvm/llvm-project (llvmorg-19.1.1 / d401987fe349a87c53fe25829215b080b70c0c1a), built it (I think according to your instructions, rather than the llvm ones - it did build though), cloned llvm-cbe into the llvm/projects folder and built it as instructed. All fine and good. I also built the whole llvm-project directory, because it seemed like I needed llvm-link, but I'm not sure if that ended up being true. I've cloned DSPFilters (master / acc49170e79a94fcb9c04b8a2116e9f8dffd1c7d), cd shared/DSPFilters/source, and do the following:
Some of the files do work, like Custom.ll, but it seems like most of them fail in this way.
I tried merging them into one .ll first, but that didn't help:
OTOH, this fails too, so I'm not sure necessarily which step of the process is failing:
Is there a flag I'm missing, or a step in the process, or something?
The text was updated successfully, but these errors were encountered: