Re: [Chicken-users] Duplicate symbol errors with functors and -static flag

2018-11-20 Thread Antoine Luciani
On Nov 20, 2018, at 6:59 PM, Evan Hanson  wrote:
> 
> Hi Antoine,
> 
> The issue here is the "./" prefix on $(SCHEME_OBJECTS). Your project
> works fine with just the following change:
> 
>3c3
>< SOURCE_PREFIX = ./
>---
> SOURCE_PREFIX =
> 
> CHICKEN uses a naive string comparison to deduplicate object files, so "./a.o"
> and "a.o" are considered to be distinct. The first of these files you provide
> explicitly in the Make rule for "test" (which is fine), while the second of
> them comes from CHICKEN's dependency resolution (as a prerequisite of the
> functor instantiation, b-foo). Because the two differ as strings, they are not
> deduplicated, both are passed to clang, and you get a linking error.
> 
> We may want to improve on this in the future by normalising filenames or
> comparing them as paths, but for right now that is the cause and what you can
> do to solve it.
> 
> All the best,
> 
> Evan
> 
> P.S. Thank you for the very high-quality reproduction.

Thanks for the fast and exhaustive answer. Your fix works for me. I can
easily rearrange my workflow and stop relying on this SOURCE_PREFIX
variable.

Best,
Antoine

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Duplicate symbol errors with functors and -static flag

2018-11-20 Thread Evan Hanson
Hi Antoine,

The issue here is the "./" prefix on $(SCHEME_OBJECTS). Your project
works fine with just the following change:

3c3
< SOURCE_PREFIX = ./
---
> SOURCE_PREFIX =

CHICKEN uses a naive string comparison to deduplicate object files, so "./a.o"
and "a.o" are considered to be distinct. The first of these files you provide
explicitly in the Make rule for "test" (which is fine), while the second of
them comes from CHICKEN's dependency resolution (as a prerequisite of the
functor instantiation, b-foo). Because the two differ as strings, they are not
deduplicated, both are passed to clang, and you get a linking error.

We may want to improve on this in the future by normalising filenames or
comparing them as paths, but for right now that is the cause and what you can
do to solve it.

All the best,

Evan

P.S. Thank you for the very high-quality reproduction.

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users