Unverified Commit f11a0c8f authored by Oran Agra's avatar Oran Agra Committed by GitHub
Browse files

Fix C11 detection in the makefile (#7822)

445a4b66 introudced a makefile script that detects if the toolchain
supports c11, and it looked that it was passing on MacOS and fails on
Ubuntu, looks like Ubuntu's Dash was spawning a background process,
deleted foo.c before gcc tried to compile it.
parent 2458e548
...@@ -31,7 +31,7 @@ OPT=$(OPTIMIZATION) ...@@ -31,7 +31,7 @@ OPT=$(OPTIMIZATION)
# Detect if the compiler supports C11 _Atomic # Detect if the compiler supports C11 _Atomic
C11_ATOMIC := $(shell sh -c 'echo "\#include <stdatomic.h>" > foo.c; \ C11_ATOMIC := $(shell sh -c 'echo "\#include <stdatomic.h>" > foo.c; \
$(CC) -std=c11 -c foo.c -o foo.o &> /dev/null; \ $(CC) -std=c11 -c foo.c -o foo.o > /dev/null 2>&1; \
if [ -f foo.o ]; then echo "yes"; rm foo.o; fi; rm foo.c') if [ -f foo.o ]; then echo "yes"; rm foo.o; fi; rm foo.c')
ifeq ($(C11_ATOMIC),yes) ifeq ($(C11_ATOMIC),yes)
STD+=-std=c11 STD+=-std=c11
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment