imageworks/OpenShadingLanguage — pull request #384 by lgritz (2014-06-23 21:14:30+00:00)
Title: Revisit and fix the "dlopen for DSO" issue with symbols LLVM can't find.

It was reported that although we took care of (almost all) function
lookups, that wasn't good enough because non-function symbols could also
be a problem. In particular, there were several ustrings referenced
externally.

The solution is just to declare them static in the functions where they
are used. I verified that it creates those static ustrings just once for
each shader, not on every shader execution. Also found a couple stray
functions I didn't catch before.

I also modified the testsuite runtest.py, so that it checks an
environment variable OSL_TESTSHADE_NAME, and if set, uses that to
override "testshade". This lets me run the full testsuite with
testshade_dso rather than testshade, verifying that we now have things
working. (Well, as best as can be verified by the coverage afforded by
the testsuite.)