Skip to content

Instantly share code, notes, and snippets.

@asciidisco
Last active January 2, 2016 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asciidisco/8326106 to your computer and use it in GitHub Desktop.
Save asciidisco/8326106 to your computer and use it in GitHub Desktop.

I have an error compiling sassc with Emscripten, maybe someone is able to point me to the failure or has an idea what I might be doing wrong here...

If I just compile sassc the "normal" way, everything works as expected.

Here are the steps I made (and their output):

$ export SASS_LIBSASS_PATH=/Users/asciidisco/Downloads/sassc/libsass
$ emmake make
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C /Users/asciidisco/Downloads/sassc/libsass
g++ -Wall -O2 -fPIC -g -c -o ast.o ast.cpp
g++ -Wall -O2 -fPIC -g -c -o base64vlq.o base64vlq.cpp
g++ -Wall -O2 -fPIC -g -c -o bind.o bind.cpp
g++ -Wall -O2 -fPIC -g -c -o constants.o constants.cpp
g++ -Wall -O2 -fPIC -g -c -o context.o context.cpp
g++ -Wall -O2 -fPIC -g -c -o contextualize.o contextualize.cpp
g++ -Wall -O2 -fPIC -g -c -o copy_c_str.o copy_c_str.cpp
g++ -Wall -O2 -fPIC -g -c -o error_handling.o error_handling.cpp
g++ -Wall -O2 -fPIC -g -c -o eval.o eval.cpp
g++ -Wall -O2 -fPIC -g -c -o expand.o expand.cpp
g++ -Wall -O2 -fPIC -g -c -o extend.o extend.cpp
g++ -Wall -O2 -fPIC -g -c -o file.o file.cpp
g++ -Wall -O2 -fPIC -g -c -o functions.o functions.cpp
g++ -Wall -O2 -fPIC -g -c -o inspect.o inspect.cpp
g++ -Wall -O2 -fPIC -g -c -o output_compressed.o output_compressed.cpp
g++ -Wall -O2 -fPIC -g -c -o output_nested.o output_nested.cpp
g++ -Wall -O2 -fPIC -g -c -o parser.o parser.cpp
g++ -Wall -O2 -fPIC -g -c -o prelexer.o prelexer.cpp
g++ -Wall -O2 -fPIC -g -c -o sass.o sass.cpp
g++ -Wall -O2 -fPIC -g -c -o sass_interface.o sass_interface.cpp
g++ -Wall -O2 -fPIC -g -c -o source_map.o source_map.cpp
g++ -Wall -O2 -fPIC -g -c -o to_c.o to_c.cpp
g++ -Wall -O2 -fPIC -g -c -o to_string.o to_string.cpp
g++ -Wall -O2 -fPIC -g -c -o units.o units.cpp
ar rvs libsass.a ast.o base64vlq.o bind.o constants.o context.o contextualize.o copy_c_str.o error_handling.o eval.o expand.o extend.o file.o functions.o inspect.o output_compressed.o output_nested.o parser.o prelexer.o sass.o sass_interface.o source_map.o to_c.o to_string.o units.o
ar: creating archive libsass.a
a - ast.o
a - base64vlq.o
a - bind.o
a - constants.o
a - context.o
a - contextualize.o
a - copy_c_str.o
a - error_handling.o
a - eval.o
a - expand.o
a - extend.o
a - file.o
a - functions.o
a - inspect.o
a - output_compressed.o
a - output_nested.o
a - parser.o
a - prelexer.o
a - sass.o
a - sass_interface.o
a - source_map.o
a - to_c.o
a - to_string.o
a - units.o
gcc -c -Wall -O2 -I /Users/asciidisco/Downloads/sassc/libsass sassc.c -o sassc.o
gcc -O2 -o bin/sassc sassc.o /Users/asciidisco/Downloads/sassc/libsass/libsass.a -lstdc++ -lm
$ emcc ./sassc.o /Users/asciidisco/Downloads/sassc/libsass/libsass.a -o sassc.test.js
WARNING  root: ./sassc.o is not valid LLVM bitcode
/Users/asciidisco/Downloads/emsdk_portable/clang/3.2_64bit/bin/llvm-nm: /var/folders/s2/bnwr2pf51vzfbv8fb0jy99sh0000gn/T/emscripten_temp_DyLbsd/ar_output_65868_0/__.SYMDEF: unrecognizable file type
llvm-link: Not enough positional command line arguments specified!
Must specify at least 1 positional arguments: See: /Users/asciidisco/Downloads/emsdk_portable/clang/3.2_64bit/bin/llvm-link -help
Traceback (most recent call last):
  File "/Users/asciidisco/Downloads/emsdk_portable/emscripten/1.8.2/emcc", line 1700, in <module>
    shared.Building.link(linker_inputs, in_temp(target_basename + '.bc'), force_archive_contents = len(filter(lambda temp: not temp.endswith(STATICLIB_ENDINGS), temp_files)) == 0)
  File "/Users/asciidisco/Downloads/emsdk_portable/emscripten/1.8.2/tools/shared.py", line 1144, in link
    assert os.path.exists(target) and (output is None or 'Could not open input file' not in output), 'Linking error: ' + output
AssertionError: Linking error:

I´m stuck here...

Some notes about my environment:

OS: OSX 10.9

$ clang --version
clang version 3.2 (tags/RELEASE_32/final)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
$ llvm-link -version
LLVM (http://llvm.org/):
  LLVM version 3.2svn
  Optimized build.
  Default target: x86_64-apple-darwin13.0.0
  Host CPU: core-avx-i
$ emcc --version
emcc (Emscripten GCC-like replacement) 1.8.2 ()
Copyright (C) 2013 the Emscripten authors (see AUTHORS.txt)
This is free and open source software under the MIT license.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ g++ --version
i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ python2 --version
Python 2.7.5

As said, if anyone has some ideas, please shoot them at me & maybe notify me via twitter @asciidisco

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment