[atom@rhel-devel Linux]$ make
JuceLibraryCode1.cpp
JuceLibraryCode2.cpp
JuceLibraryCode3.cpp
JuceLibraryCode4.cpp
Linking The Jucer
build/intermediate/Debug/JuceLibraryCode1.o: In function `juce::Atomic::decrementAndReturn(int&)':
/home/atom/devel/juce/extras/Jucer (experimental)/Builds/Linux/../../JuceLibraryCode/../../../amalgamation/../src/core/juce_Atomic.h:109: undefined reference to `__sync_add_and_fetch_4'
build/intermediate/Debug/JuceLibraryCode1.o: In function `juce::Atomic::incrementAndReturn(int&)':
/home/atom/devel/juce/extras/Jucer (experimental)/Builds/Linux/../../JuceLibraryCode/../../../amalgamation/../src/core/juce_Atomic.h:107: undefined reference to `__sync_add_and_fetch_4'
build/intermediate/Debug/JuceLibraryCode1.o: In function `juce::Atomic::swapPointers(void* volatile*, void*)':
/home/atom/devel/juce/extras/Jucer (experimental)/Builds/Linux/../../JuceLibraryCode/../../../amalgamation/../src/core/juce_Atomic.h:116: undefined reference to `__sync_bool_compare_and_swap_4'
build/intermediate/Debug/JuceLibraryCode2.o: In function `juce::Atomic::compareAndExchange(int&, int, int)':
/home/atom/devel/juce/extras/Jucer (experimental)/Builds/Linux/../../JuceLibraryCode/../../../amalgamation/../src/containers/../core/juce_Atomic.h:111: undefined reference to `__sync_val_compare_and_swap_4'
collect2: ld returned 1 exit status
make: *** [build/Jucer] Error 1
i had to add -march=i686 to build it (-march=native caused some other errors so i removed it, but a minimum of i486 has to be set cause that’s when those atomic calls appeared).
[atom@rhel-devel Linux]$ make
jucer_ComponentDocument.cpp
../../Source/model/jucer_ComponentDocument.cpp:1: error: bad value (native) for -march= switch
../../Source/model/jucer_ComponentDocument.cpp:1: error: bad value (native) for -mtune= switch
make: *** [build/intermediate/Debug/jucer_ComponentDocument.o] Error 1
i486 is enough, and it would be safe to add i486 cause i can’t think of a cpu that runs linux/juce and is not i486 compatible.
I didn’t mean that i686 was too recent, I meant that people could be using ppc or other non-x86 architectures. I don’t understand why you’d get that error though… Any gcc experts know why it’d object to arch=native?
Well i think you solved this in some very bad way.
#error "Linux build requires gcc4.2 or later for atomic operations"
that’s not true, you can use any gcc4 but you need to pass a different switch to gcc cli, you just removed support for a lot of distros and versions on linux.
well any switch that will work with -march option, native does not work in gcc < 4.2 but -march=i486 works and JUCE builds just fine (i’m building it). Maybe you could add a architecture combo for projects?
It works fine if you just don't use any -march. GCC is version 4.1.2. I think it would be fine to use the GCC version and if less than 4.2, just set TARGET_ARCH="" in the Makefile.