[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Portability problem in rtems custom cfg's



On Mon, 9 Aug 1999, David Sotkowitz wrote:

> In the cfg sources, SED is used to remove CR-LF,and leave a LF on Unix.
> The problem is, on NT, where the removal is unnecessary, a nibble is
> removed from the checksum at the end of the srecord when generating the exe.

My first response is that this is a bug in sed on cygwin. :)

The history behind this is that some of the monitors for the boards listed
below either (1) did not like the extra LF (i.e. refused to download
unless it was removed) or (2) did not care and thus you saved a few
seconds of download time.

> The bug is in RTEMS 4.0.0


> The following diff provides a modification that will work. Alternately,
> one could conditionalize on ostype.

If objcopy ever changes where it does not generate the extra \r, then this
will also strip the last nibble.

Ralf .. David .. any ideas what is the best thing to do?  

> --- rtems-current/make/custom/rwi5307.cfg.orig	Mon Aug 09 12:55:00 1999
> +++ rtems-current/make/custom/rwi5307.cfg	Mon Aug 09 12:38:05 1999
> @@ -71,7 +71,7 @@
>  	$(LD) $(LDFLAGS) -N -T $(LINKCMDS) -o $(basename $@).nxe \
>  	    $(START_FILE) $(LINK_OBJS) --start-group $(LINK_LIBS) --end-group
>  	$(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).i
> -	$(SED) -e 's/.$$//' -e '/^S0/d' $(basename $@).i | \
> +	$(SED) -e 's/\r$$//' -e '/^S0/d' $(basename $@).i | \
>  	    $(PROJECT_TOOLS)/packhex > $(basename $@).exe
>  	$(NM) -g -n $(basename $@).nxe > $(basename $@).num
>  	$(SIZE) $(basename $@).nxe
> @@ -81,7 +81,7 @@
>  	$(CC) $(CFLAGS) $(CFLAGS_LD) -o $(basename $@).nxe \
>  	    $(LINK_OBJS) $(LINK_LIBS)
>  	$(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).i
> -	$(SED) -e 's/.$$//' -e '/^S0/d' $(basename $@).i | \
> +	$(SED) -e 's/\r$$//' -e '/^S0/d' $(basename $@).i | \
>  	    $(PROJECT_TOOLS)/packhex > $(basename $@).exe
>  	$(NM) -g -n $(basename $@).nxe > $(basename $@).num
>  	$(SIZE) $(basename $@).nxe
> 
> Other affected files with the same problem (all in make/custom):
> 
> dmv152.cfg
> efi332.cfg
> efi68k.cfg
> force386.cfg
> i386ex.cfg
> idp.cfg
> mvme136.cfg
> mvme147.cfg
> memv162.cfg
> rwi5307.cfg (above)
> sbc5206.cfg
> sbc5307.cfg
> 
>