Giter Club home page Giter Club logo

Comments (6)

doedre avatar doedre commented on June 19, 2024 2

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.

marcs-feh avatar marcs-feh commented on June 19, 2024

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.

doedre avatar doedre commented on June 19, 2024

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.

Kelimion avatar Kelimion commented on June 19, 2024

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.

eliaspekkala avatar eliaspekkala commented on June 19, 2024

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.

laytan avatar laytan commented on June 19, 2024

From the temporary fix it seems like using the -gnu suffixed targets makes it link in gcc?

Maybe this line needs changing:

str_lit("x86_64-pc-linux-gnu"),

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.