Scons OSX master compile error (clang 3.5)

OS X 10.9.5, Xcode 6.1, building with clang-Open MP I get this error:

Compiling ==> 'light.cpp'
0  clang-3.5                0x00000001086f33c8 llvm::sys::PrintStackTrace(__sFILE*) + 40
1  clang-3.5                0x00000001086f38a4 SignalHandler(int) + 452
2  libsystem_platform.dylib 0x000000010aa165aa _sigtramp + 26
3  libsystem_platform.dylib 0x00007fd2ecf1b810 _sigtramp + 3796914816
4  clang-3.5                0x000000010864dd6c (anonymous namespace)::IPSCCP::runOnModule(llvm::Module&) + 3932
5  clang-3.5                0x000000010844db66 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 950
6  clang-3.5                0x0000000108ac44ca clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) + 6010
7  clang-3.5                0x0000000108c0664b clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 523
8  clang-3.5                0x0000000108efafd4 clang::ParseAST(clang::Sema&, bool, bool) + 452
9  clang-3.5                0x0000000108c05120 clang::CodeGenAction::ExecuteAction() + 80
10 clang-3.5                0x00000001088cb62e clang::FrontendAction::Execute() + 62
11 clang-3.5                0x00000001088a0163 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 851
12 clang-3.5                0x0000000108900871 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 4417
13 clang-3.5                0x0000000107b9fbc1 cc1_main(char const**, char const**, char const*, void*) + 913
14 clang-3.5                0x0000000107b9c9c2 main + 1138
15 libdyld.dylib            0x000000010a77c5fd start + 1
16 libdyld.dylib            0x00000000000001ec start + 4119346160
Stack dump:
0.    Program arguments: /Users/paolo/blender-build-git/lib/darwin-9.x.universal/clang-omp-3.5/bin/clang-3.5 -cc1 -fopenmp -triple x86_64-apple-macosx10.6.0 -emit-obj -disable-free -disable-llvm-verifier -main-file-name image.cpp -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -menable-no-infs -menable-no-nans -menable-unsafe-fp-math -ffp-contract=fast -ffast-math -masm-verbose -munwind-tables -target-cpu core2 -target-feature +sse -target-feature +sse2 -target-feature +sse3 -target-feature +ssse3 -dwarf-column-info -coverage-file /Users/paolo/blender-build-git/build/darwin/intern/cycles/render/image.o -resource-dir /Users/paolo/blender-build-git/lib/darwin-9.x.universal/clang-omp-3.5/bin/../lib/clang/3.5.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -D WITH_MOD_FLUID -D WITH_MOD_OCEANSIM -D __LITTLE_ENDIAN__ -D WITH_AUDASPACE -D WITH_AVI -D WITH_OPENNL -D HAVE_STDBOOL_H -D NDEBUG -D WITH_GL_PROFILE_COMPAT -D GLEW_STATIC -D WITH_SMOKE -D WITH_FRAMESERVER -D WITH_PYTHON -D WITH_SDL -D WITH_OPENIMAGEIO -D WITH_OPENEXR -D WITH_TIFF -D WITH_OPENJPEG -D WITH_DDS -D WITH_CINEON -D WITH_HDR -D WITH_FFMPEG -D WITH_QUICKTIME -D WITH_BULLET -D WITH_MOD_FLUID -D WITH_OCEANSIM -D WITH_LZO -D WITH_LZMA -D WITH_GAMEENGINE -D WITH_LIBMV -D FFTW3=1 -D WITH_FREESTYLE -D WITH_GAMEENGINE -D WITH_SMOKE -D WITH_DDS -D WITH_PYTHON -D WITH_PYTHON -D WITH_GAMEENGINE -D WITH_FREESTYLE -D WITH_BULLET -D WITH_FREESTYLE -D WITH_OPENJPEG -D WITH_OPENEXR -D WITH_TIFF -D WITH_OPENIMAGEIO -D WITH_FREESTYLE -D WITH_OPENEXR -D WITH_OPENJPEG -D WITH_TIFF -D WITH_CINEON -D WITH_OPENIMAGEIO -D WITH_COMPOSITOR -D WITH_PYTHON -D WITH_GAMEENGINE -D WITH_FREESTYLE -D WITH_PYTHON -D WITH_PYTHON -D WITH_GAMEENGINE -D WITH_PYTHON -D WITH_PYTHON -D WITH_COMPOSITOR -D WITH_FREESTYLE -D WITH_PYTHON -D WITH_COLLADA -D WITH_BUILDINFO -D WITH_COMPOSITOR -D WITH_PYTHON_SECURITY -D WITH_SMOKE -D WITH_BULLET -D WITH_OPENIMAGEIO -D WITH_OPENEXR -D WITH_TIFF -D WITH_OPENJPEG -D WITH_DDS -D WITH_CINEON -D WITH_HDR -D WITH_FRAMESERVER -D WITH_FFMPEG -D WITH_QUICKTIME -D WITH_GAMEENGINE -D WITH_FFTW3 -D WITH_SDL -D WITH_OPENAL -D WITH_PYTHON -D WITH_COLLADA -D WITH_CYCLES -D WITH_FREESTYLE -D NDEBUG -D WITH_SMOKE -D WITH_BULLET -D WITH_OPENIMAGEIO -D WITH_OPENEXR -D WITH_TIFF -D WITH_OPENJPEG -D WITH_DDS -D WITH_CINEON -D WITH_HDR -D WITH_FRAMESERVER -D WITH_FFMPEG -D WITH_QUICKTIME -D WITH_GAMEENGINE -D WITH_PYTHON -D WITH_COLLADA -D WITH_OCEANSIM -D WITH_CYCLES -D WITH_SDL -D WITH_OPENAL -D WITH_FREESTYLE -D BUILD_DATE -D WITH_BULLET -D WITH_FFMPEG -D WITH_QUICKTIME -D WITH_SNDFILE -D WITH_COMPOSITOR -D WITH_CYCLES -D WITH_CYCLES_OSL -D WITH_FREESTYLE -D WITH_GAMEENGINE -D WITH_CINEON -D WITH_DDS -D WITH_FRAMESERVER -D WITH_HDR -D WITH_OPENEXR -D WITH_OPENJPEG -D WITH_TIFF -D WITH_OPENAL -D WITH_SDL -D WITH_LIBMV -D WITH_MOD_BOOLEAN -D WITH_MOD_FLUID -D WITH_OCEANSIM -D WITH_MOD_REMESH -D WITH_SMOKE -D WITH_COLLADA -D WITH_OCIO -D WITH_OPENIMAGEIO -D WITH_PLAYER -D WITH_FFMPEG -D WITH_PYTHON -D WITH_SDL -D WITH_PYTHON -D WITH_FFMPEG -D WITH_BULLET -D WITH_PYTHON -D WITH_PYTHON -D WITH_PYTHON -D WITH_FFMPEG -D WITH_PYTHON -D WITH_PYTHON -D WITH_FFMPEG -D WITH_PYTHON -D WITH_BULLET -D WITH_QUICKTIME -D WITH_OCIO -D CCL_NAMESPACE_BEGIN=namespace ccl { -D CCL_NAMESPACE_END=} -D WITH_OPENCL -D WITH_MULTI -D WITH_CUDA -D WITH_OSL -D OSL_STATIC_LIBRARY -D WITH_CYCLES_LOGGING -D GOOGLE_GLOG_DLL_DECL= -D WITH_KERNEL_AVX2 -D WITH_KERNEL_SSE41 -D WITH_KERNEL_AVX -D WITH_KERNEL_SSE3 -D WITH_KERNEL_SSE2 -I /Users/paolo/blender-build-git/lib/darwin-9.x.universal/openmp/include -I /Users/paolo/blender-build-git/lib/darwin-9.x.universal/osl/include -I extern/libmv/third_party/glog/src -I extern/libmv/third_party/gflags -I /Users/paolo/blender-build-git/build/darwin/intern/cycles -I intern/cycles -I /Users/paolo/blender-build-git/build/darwin/intern/cycles/bvh -I intern/cycles/bvh -I /Users/paolo/blender-build-git/build/darwin/intern/cycles/render -I intern/cycles/render -I /Users/paolo/blender-build-git/build/darwin/intern/cycles/device -I intern/cycles/device -I /Users/paolo/blender-build-git/build/darwin/intern/cycles/kernel -I intern/cycles/kernel -I /Users/paolo/blender-build-git/build/darwin/intern/cycles/kernel/osl -I intern/cycles/kernel/osl -I /Users/paolo/blender-build-git/build/darwin/intern/cycles/kernel/svm -I intern/cycles/kernel/svm -I /Users/paolo/blender-build-git/build/darwin/intern/cycles/util -I intern/cycles/util -I /Users/paolo/blender-build-git/build/darwin/intern/cycles/subd -I intern/cycles/subd -I intern/guardedalloc -I source/blender/makesrna -I source/blender/makesdna -I source/blender/blenlib -I source/blender/blenloader -I /Users/paolo/blender-build-git/build/darwin/source/blender/makesrna/intern -I source/blender/makesrna/intern -I extern/glew/include -I intern/glew-mx -I intern/atomic -I intern/mikktspace -I extern/glew/include -I extern/clew/include -I extern/cuew/include -I intern/mikktspace -I /Users/paolo/blender-build-git/lib/darwin-9.x.universal/openimageio/include -I /Users/paolo/blender-build-git/lib/darwin-9.x.universal/boost/include -I /Users/paolo/blender-build-git/lib/darwin-9.x.universal/openexr/include -I /Users/paolo/blender-build-git/lib/darwin-9.x.universal/openexr/include/OpenEXR -I /Users/paolo/blender-build-git/lib/darwin-9.x.universal/python/include/python3.4m -O2 -Wno-invalid-offsetof -Wno-sign-compare -Wall -fdeprecated-macro -fdebug-compilation-dir /Users/paolo/blender-build-git/blender -ftemplate-depth 1024 -ferror-limit 19 -fmessage-length 173 -stack-protector 1 -mstackrealign -fblocks -fno-signed-char -fobjc-runtime=macosx-10.6.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o /Users/paolo/blender-build-git/build/darwin/intern/cycles/render/image.o -x c++ intern/cycles/render/image.cpp 
1.    <eof> parser at end of file
2.    Per-module optimization passes
3.    Running pass 'Interprocedural Sparse Conditional Constant Propagation' on module 'intern/cycles/render/image.cpp'.
clang-3.5: error: unable to execute command: Segmentation fault: 11
clang-3.5: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 3.5.0 
Target: x86_64-apple-darwin13.4.0
Thread model: posix
clang-3.5: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
clang-3.5: note: diagnostic msg: 
********************


PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.5: note: diagnostic msg: /var/folders/pn/flbtzz5s4fbg1xx9qsgmh7d80000gn/T/image-6eff0a.cpp
clang-3.5: note: diagnostic msg: /var/folders/pn/flbtzz5s4fbg1xx9qsgmh7d80000gn/T/image-6eff0a.sh
clang-3.5: note: diagnostic msg: 


********************
scons: *** [/Users/paolo/blender-build-git/build/darwin/intern/cycles/render/image.o] Error 254
2 warnings generated.
scons: building terminated because of errors.



Any assistance appreciated, please let me know if further infos are needed.

Thank you,
paolo

Disabling OSL should help while the problem is being resolved.

EDIT: Also you may have to svn update your lib directory.

Thank you Psy-Fy,
I’m going to try and disable OSL, I have already updated the lib before my attempt.

Cheers,
paolo

Disabled OSL compiling, the lib directory is up to date, though I still get this error:

Linking program ==> 'blender'
Linking program ==> 'blenderplayer'
ld: library not found for -lSDL
ld: library not found for -lSDL
clang-3.5: error: linker command failed with exit code 1 (use -v to see invocation)clang-3.5
: error: linker command failed with exit code 1 (use -v to see invocation)
scons: *** [/Users/paolo/blender-build-git/build/darwin/bin/blenderplayer] Error 1
scons: *** [/Users/paolo/blender-build-git/build/darwin/bin/blender] Error 1
scons: building terminated because of errors.

EDIT: I also tried disabling BF_SDL without success.

EDIT 2/correction: I was wrong, disabling SDL did the work, (I don’t know why the first time it didn’t, maybe I forgot to save the changes)

Anyway I would like to know what is wrong with it, but my general understanding doesn’t suffice.
In the ‘lib/darwin-9.x.universal/sdl/include/SDL_config_macosx’ you can read:

#ifdef MAC_OS_X_VERSION_10_8
/*
 * No matter the versions targeted, this is the 10.8 or later SDK, so you have
 *  to use the external Xquartz, which is a more modern Xlib. Previous SDKs
 *  used an older Xlib.
 */

Can it be relevant?

paolo

After disabling SDL, I tried re-enabling OSL and it compiles successfully, then the culprit seems to be just SDL.

paolo

Justing passing by and linking your request to more advanced users, Paolo.
I hope you found a workaround.
Still being able to build under OSX 10.8.5 thanks to Psyfi
What will happen after updating my OSX is another matter. LOL

Thank you michalis,
for the moment I can survive, I also hope to find a solution for the future.
About OS X upgrading, I would suggest to stay with 10.8.x as long as possible (you should see what kind of mess Yosemite is, fortunately I installed it on external disk, and immediately I threw it away, I mean yosemite, not the disk,LOL)

paolo

Solved!

I failed to update the user-config.py, when I changed BF_SDL_LIB = ‘SDL’ to BF_SDL_LIB = ‘SDL2’ then I was able to set ‘WITH_BF_SDL = True’.

paolo