On Thu, Jan 5, 2017 at 8:52 PM, Andreas Kloeckner
<li...@informa.tiker.net> wrote:
> Erik,
>
> Erik Schnetter <eschnet...@perimeterinstitute.ca> writes:
>> Some long shots, assuming you already thought of the more plausible things:
>>
>> How clever is Conda when it replaces these strings? For example, if
>> the pattern string is "placehold", and the binary contains the string
>> "placehold/include", would the "/include" suffix be preserved or cut
>> off?
>>
>> Did you use "strings" to analyze the generated binary? This might tell
>> you what strings there are, and whether Conda's algorithm will work.
>> The linker might be coalescing and sharing parts of string literals.
>>
>> ... maybe the compiler contains an optimization that evaluates string
>> concatenation at compile time? (Would be nice, but I don't think so.)
>
> Thanks for your suggestions! It turns out your last point was pretty
> close. strlen() was being evaluated at compile time, from within the
> inlined std::string constructor. Moving the strings to a separate
> translation unit seems to have taken care of that.

Amazing.

Well, all is fine now ... until someone discovers the "-flto" option
while building pocl.

Maybe you want to suggest to the Conda developers to keep the string
length constant, filling it with "///" or "/./././" instead?

Or should we instead look at an environment variable instead of
hard-coding a path, if Conda can provide a respective variable?

We could also put the string into a char[] array; this would then not
be constant, and likely preclude any compile-time optimization.

-erik

> Recipe here:
> https://github.com/inducer/staged-recipes/tree/pocl/recipes/pocl
>
> I'll also submit this for autobuilding in conda-forge once clang [1] is
> in. Packages here in the meantime:
>
> https://anaconda.org/inducer/repo
>
> [1] https://github.com/conda-forge/staged-recipes/pull/1481
>
> Andreas



-- 
Erik Schnetter <eschnet...@perimeterinstitute.ca>
http://www.perimeterinstitute.ca/personal/eschnetter/
AIM: eschnett247, Skype: eschnett, Google Talk: schnet...@gmail.com

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
pocl-devel mailing list
pocl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pocl-devel

Reply via email to