[erlang-questions] [PATCH] Fix R15B02 cross-compilation for TileraMDE-3.0.1.125620

Motiejus Jakštys desired.mta@REDACTED
Thu Oct 11 08:45:48 CEST 2012


On Wed, Oct 10, 2012 at 05:09:10PM +0200, Björn-Egil Dahlberg wrote:
> On 2012-10-10 16:08, Motiejus Jaks(tys wrote:
> >Applying the patch below let me cross-compile and run R15B02 on Tilera64
> >using TileraMDE-3.0.1.125620.
> >
> >In order to prepare a clean patch, I have to know what do the options
> >-OPT:Olimit=0 -WOPT:lpre=off:spre=off:epre=off do on the machines that
> >support it? Also, what is the meaning of -MALLOC_USE_HASH(1)?
> 
> I am quoting from Tilera here:

Is documentation open? Would it be possible to get a link/reference?
Maybe there is any documentation on this feature in "compatibility
notes" or "migration guide" of some kind? I could ask Tilera for this.

> "'malloc_use_hash' only affects malloc (specifically, it affects the
> flags it passes to 'mmap' when it allocates more memory from Linux).
> You can also explicitly malloc memory with various caching attributes
> using custom mspaces.
> 
> The 'hash_default' argument in the .hvconfig file affects 'mmap' calls
> that do not specify homing information.  Because malloc*does*  specify
> homing information, at least when you are pthreaded, 'hash_default' is
> ignored and malloc_use_hash is required to get hash-for-home."
> 
> 
> This was something included in TileraMDE 2.0 beta (perhaps removed
> since then).
> I found it in TileraMDE-2.1.2/tile64/tile/usr/include/malloc.h though.

All right. So it was there, and was removed.

I think it would make sense to conditionalize it during configuration
phase. But how to test for its existence/absence?

> I guess it would be safe to remove "-OPT:Olimit=0
> -WOPT:lpre=off:spre=off:epre=off ".
> It is an optimization for tile-cc when compiling on target machine.
> An earlier comment in Makefile.in seems to have been removed, it said:
> 
> +ifneq ($(filter tile-%,$(TARGET)),)
> +# Some tile-cc optimizations take pathologically long for beam_emu.c,
> +# so disable them.
> +$(OBJDIR)/beam_emu.o: beam/beam_emu.c
> +	$(CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) \
> +	  -OPT:Olimit=0 -WOPT:lpre=off:spre=off:epre=off \
> +	  $(INCLUDES) -c $< -o $@
> +endif

Can you verify that it compiles in "reasonable time" on your system with
these flags turned off?

> Patch was supplied by Tilera Corp.

That is fantastic.

Motiejus



More information about the erlang-questions mailing list