concurrencykit / ck

Concurrency primitives, safe memory reclamation mechanisms and non-blocking (including lock-free) data structures designed to aid in the research, design and implementation of high performance concurrent systems developed in C99+.
http://concurrencykit.org/
Other
2.38k stars 313 forks source link

configure breaks when cross-compiling #158

Closed jonathan-geisler closed 4 years ago

jonathan-geisler commented 4 years ago

The configure script tries to build a program that it can execute to determine the compiler version being used. This does not work properly when cross-compiling because the executable cannot run on the host machine. There needs to be a way to provide this information when cross compiling so that this step can be avoided. Maybe do something like ${CC} --version and parse the output there since the compiler must execute on the host?

sbahra commented 4 years ago

Makes sense. Will look into addressing this and otherwise happy to take patches sooner!

sbahra commented 4 years ago

@jonathan-geisler One thing I forgot to mention: Cross-compilation is usually done today using build profiles. See the --profile option. If you're blocked on this, you may want to take this route. This removes the need to do a lot checks as well. Does this work for your use-case?

Parsing compiler version output is a bit of a PITA given the number of supported compilers, it also becomes a maintenance burden as more compilers are supported, but I'll check for feasibility of it.

jonathan-geisler commented 4 years ago

I am not blocked because I was able to make this change to the code:

#COMPILER=`./.` 2> /devnull`
COMPILER="gcc" # hack to allow cross-compiling

The --profile option could work in the long run, but it doesn't get checked until after this line of code, so it is not quite enough to fix the problem permanently.

igorpupkinable commented 11 months ago

Parsing compiler version output is a bit of a PITA given the number of supported compilers, it also becomes a maintenance burden as more compilers are supported, but I'll check for feasibility of it.

I am not sure you need to parse compiler output. $CC --version || return 1 or $CC --help || return 1 should be just fine.