Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux: Shared Debug Library Broken #2052

Closed
kphillisjr opened this issue Nov 18, 2016 · 1 comment
Closed

Linux: Shared Debug Library Broken #2052

kphillisjr opened this issue Nov 18, 2016 · 1 comment
Assignees

Comments

@kphillisjr
Copy link
Contributor

I have found that the Shared Debug library for linux does not work correctly. There is internal assert failures. The steps to reproduce are fairly straight forward if you follow the wiki with some slight changes( see: Microsoft/ChakraCore Wiki: Embedding ChakraCore).

The steps to reproduce the issue are as follows...

  1. Create a clean checkout of the Master ChakraCore branch.
  2. Meet all build dependencies for ChakraCore. In my case I use Ubuntu 16.04 LTS with packaged versions of cmake, clang, ninja ( ninja-build package), and others.
  3. Build chakracore debug library
# Run this in root directory for ChakraCore.
./build.sh -n -d
  1. Wait for build to finish.
  2. prepare an example runtime/link folder using above...
	cd BuildLinux
	mkdir DebugLibTest
	cd DebugLibTest
	# This command is for Linux.
	cp ../Debug/libChakraCore.so .
	# This is for OSX/Darwin.
	#cp ../Debug/libChakraCore.dylib .
	# add Headers.
	mkdir include
	cd include
	# This will copy the four core headers outlined at...
	# https://github.com/Microsoft/ChakraCore/wiki/Embedding-ChakraCore
	cp ../../../lib/Jsrt/Chakra*.h .
  1. Build an example... In this Case I use the Hello World example as the source... (see: https://github.com/Microsoft/Chakra-Samples/blob/master/ChakraCore%20Samples/Hello%20World/Linux_OSX/sample.cpp )
	# NOTE: Copy sample.cpp from the Chakra Core Hello World example for Linux/OSX here.
	# Build example on a Linux System...
	clang++ sample.cpp $(pwd)/libChakraCore.so -Wl,-rpath,. -Iinclude -o Sample -std=c++11
	# Build example on a OS X/Darwin System... - NOTE: I have not tested this.
	# clang++ sample.cpp $(pwd)/libChakraCore.dylib -Wl,-rpath,. -Iinclude -o Sample -std=c++11
  1. run the example.
     ./Sample
     # This should output Hello World, but instead it crashes.
@obastemur
Copy link
Collaborator

@kphillisjr xplat shared library requires an explicit call to DllMain first. See our python example https://github.com/Microsoft/Chakra-Samples/blob/master/ChakraCore%20Samples/Hello%20World/Python/helloWorld.py#L23-L28

Thanks for the detailed report. I'm closing this one since we follow this issue from #1811

@obastemur obastemur removed the Bug label Nov 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants