Giter Site home page Giter Site logo

could not compile about bah HOT 6 OPEN

ithirzty avatar ithirzty commented on July 19, 2024
could not compile

from bah.

Comments (6)

ithirzty avatar ithirzty commented on July 19, 2024

There shouldn't be any problem with musl.

Compiling your program should work with "bah merhaba.bah" (using gcc).

If you want to use TCC, you will need to pass the "-d" option to make the executable dynamicaly linked. Doing so will require you to have libgc.so installed on your system.

from bah.

ithirzty avatar ithirzty commented on July 19, 2024

Also, you can use "-verboseCC" to see the C compiler output without doing multiple commands.

from bah.

0verse avatar 0verse commented on July 19, 2024

bah with gcc or tcc does give cc error:

bah merhaba.bah -verboseCC
Parsed. (2138 lines, total time: 13ms, lexer time: 3ms)
/an/duyum/etki/ld: /opt/bah/libs/linux//libgc.a(pthread_support.o): in function setup_mark_lock': /run/media/alois/7E78027F78023685/prog/bdwgc/bdwgc/pthread_support.c:2508: undefined reference to gnu_get_libc_version'
/an/duyum/etki/ld: /opt/bah/cache/aoptabahabuiltinbbah00.o.o: in function __BAH_panic': /opt/bah/<stdin>:285: undefined reference to backtrace'
/an/duyum/etki/ld: /opt/bah/libs/linux//libgc.a(mach_dep.o): in function GC_with_callee_saves_pushed': /run/media/alois/7E78027F78023685/prog/bdwgc/bdwgc/mach_dep.c:345: undefined reference to getcontext'
/an/duyum/etki/ld: /opt/bah/libs/linux//libgc.a(pthread_start.o): in function GC_pthread_start_inner': /run/media/alois/7E78027F78023685/prog/bdwgc/bdwgc/pthread_start.c:53: undefined reference to __pthread_register_cancel'
/an/duyum/etki/ld: /run/media/alois/7E78027F78023685/prog/bdwgc/bdwgc/pthread_start.c:62: undefined reference to `__pthread_unregister_cancel'
collect2: error: ld returned 1 exit status

[CC-ERROR]
Could not compile.

from bah.

ithirzty avatar ithirzty commented on July 19, 2024

The Bah compiler links your executable with a static version of libgc shipped with the compiler by default.

  1. You may need to install libgc and link your executable dynamically instead (-d flag).
  2. Your version of libc does not have the backtrace() function implemented.

You can bypass the second problem easily by typing backtrace(arr ptr, l int) int {} at the top of your program while I try to get rid of non posix functions. Note that doing this sketchy thing will break the panic() backtrace...

from bah.

0verse avatar 0verse commented on July 19, 2024

backtrace error dissapeared but libgc error still persists:

bah merhaba.bah -verboseCC -d
Parsed. (2140 lines, total time: 17ms, lexer time: 4ms)
/an/duyum/etki/ld: /opt/bah/libs/linux//libgc.a(pthread_support.o): in function setup_mark_lock': /run/media/alois/7E78027F78023685/prog/bdwgc/bdwgc/pthread_support.c:2508: undefined reference to gnu_get_libc_version'
/an/duyum/etki/ld: /opt/bah/libs/linux//libgc.a(mach_dep.o): in function GC_with_callee_saves_pushed': /run/media/alois/7E78027F78023685/prog/bdwgc/bdwgc/mach_dep.c:345: undefined reference to getcontext'
/an/duyum/etki/ld: /opt/bah/libs/linux//libgc.a(pthread_start.o): in function GC_pthread_start_inner': /run/media/alois/7E78027F78023685/prog/bdwgc/bdwgc/pthread_start.c:53: undefined reference to __pthread_register_cancel'
/an/duyum/etki/ld: /run/media/alois/7E78027F78023685/prog/bdwgc/bdwgc/pthread_start.c:62: undefined reference to `__pthread_unregister_cancel'
collect2: error: ld returned 1 exit status

from bah.

ithirzty avatar ithirzty commented on July 19, 2024

libgc (https://github.com/ivmai/bdwgc) was made using the GNU libc.

I cannot guarantee that this library will work with Musl...
You can try compiling your program with "-lightGC" to remove the libgc dependency. Note that this is meant for really simple programs. lightgc.bah is still being developed.

from bah.

Related Issues (1)

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.