Comments (6)
It can be temporarily fixed by specifying your target triple here. On my setup it's x86_64-alpine-linux-musl
, so it should look like this:
bc->link_flags = concatenate3_strings(permanent_allocator(),
str_lit("-target "), str_lit("x86_64-alpine-linux-musl"), str_lit(" "));
Tried to compile ols
with it, works fine. Can't really come up with a better solution yet, as I'm not very familiar with the codebase.
from odin.
I also had the same issue on Alpine. Here's a workaround you can do:
odin build your_dir -reloc-mode:pic -build-mode:obj
clang -fPIE your_dir.o -o your_executable
I have no idea why it's trying to link -lgcc
.
from odin.
git bisect
pointed me to d1a1e8f646c5b959be638aa955856f686b11a4f3
as the first faulty commit. Updating to LLVM 18.1.6 did not resolve this issue. Don't see where it tries to link -lgcc
either.
from odin.
I can't replicate it on Ubuntu 24.04.
For LLVM 18:
[10:18] jeroen@CALISTO:/mnt/w/Odin $ ./build_odin.sh
+ /usr/lib/llvm-18/bin/clang++ src/main.cpp src/libtommath.cpp -Wno-switch -Wno-macro-redefined -Wno-unused-value -DODIN_VERSION_RAW="dev-2024-05" -DGIT_SHA="856537f0c" -std=c++14 -I/usr/lib/llvm-18/include -std=c++17 -fno-exceptions -funwind-tables -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -L/usr/lib/llvm-18/lib -g -pthread -lm -lstdc++ -ldl /usr/lib/llvm-18/lib/libLLVM-18.so -Wl,-rpath=$ORIGIN -o odin
+ set +x
# the basics
Hellope, World! from /mnt/w/Odin/demo.
<snip>
LLVM 17 either:
jeroen@CALISTO:/mnt/w/Odin $ LLVM_CONFIG=llvm-config-17 ./build_odin.sh
+ /usr/lib/llvm-17/bin/clang++ src/main.cpp src/libtommath.cpp -Wno-switch -Wno-macro-redefined -Wno-unused-value -DODIN_VERSION_RAW="dev-2024-05" -DGIT_SHA="856537f0c" -std=c++14 -I/usr/lib/llvm-17/include -std=c++17 -fno-exceptions -funwind-tables -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -L/usr/lib/llvm-17/lib -g -pthread -lm -lstdc++ -ldl /usr/lib/llvm-17/lib/libLLVM-17.so -Wl,-rpath=$ORIGIN -o odin
+ set +x
# the basics
Hellope, World! from /mnt/w/Odin/demo.
from odin.
Thanks. I can confirm that this temporary fix works.
@laytan Seeing as you have worked on this part of the codebase before, do you know how we could make a more permanent fix to this issue?
from odin.
From the temporary fix it seems like using the -gnu
suffixed targets makes it link in gcc?
Maybe this line needs changing:
Line 968 in d99e161
Something like x86_64-pc-linux-elf
instead?
But these are just initial guesses, I will try to find some time to test/reproduce this
from odin.
Related Issues (20)
- Compiler assertion for conversion from i32 to union{i32} HOT 1
- `core:odin/parser` package doesn't support putting labels on `#reverse for in` loops HOT 1
- Identity quaternion shows wrong value in debugger
- `linalg.angle_axis_from_quaternion` returns `[NaN, NaN, NaN]` axis for identity quaternion HOT 1
- `#force_*inline` after label segfaults HOT 1
- Poly code crashes compiler. HOT 1
- [Feature Request] add sqlite3 to vendor collection HOT 2
- Taking address of loop variable silently crashes compiler
- Odin diagnostics get messed up by non-ASCII codepoints HOT 4
- Unable to assign to `#soa` array using struct literal with named fields
- Incorrect hexadecimal literal is an invalid token HOT 1
- Compiler loops infinitely if error line is truncated HOT 1
- Infinite loop when compiling procedure with weird parapoly signature HOT 2
- Macos Intel crashes on calling `linalg.mul`
- Redeclaration of 'iso8601_to_time_utc' in this scope HOT 4
- some_var := -SOME_CONSTANT_VECTOR doesn't work
- `slice.unique` still returns incorrect slice HOT 2
- <spam>
- Compiler crashes with LLVM error HOT 3
- Clang won't be found if not aliased?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from odin.