[M3devel] adding new target?

Daniel Alejandro Benavides D. dabenavidesd at yahoo.es
Fri Nov 4 18:07:52 CET 2011


Hi all:
in that case, it isn't the LINUXLIBC6 a better name for these targets (at least in Debian 3.0 or so), I mean, not necessarily embedded speaking. And then what does it mean that is not more or less upward "compatibility".
Thanks in advance

--- El vie, 4/11/11, Jay K <jay.krell at cornell.edu> escribió:

De: Jay K <jay.krell at cornell.edu>
Asunto: Re: [M3devel] adding new target?
Para: "Mika Nystrom" <mika at async.caltech.edu>, "m3devel" <m3devel at elegosoft.com>
Fecha: viernes, 4 de noviembre, 2011 11:35




 Please put "32" in the name of the target? That's just preference/taste, not a requirement. 


  > cd ../FreeBSD4-I386_FREEBSD 


 We got confused and are building a host=FreeBSD4 target=I386_FREEBSD backend. 
 I realize that is also confusing. But it is how you can transition from the old target names to the new ones.


  > ../src/runtime/common/RTHooks.i3:15: fatal error:  *** illegal type: 0x6f, at m3cg_lineno 5  


  And then later on we probably confused .ic/.mc files for assembly source or vice versa.  


 See http://modula3.elegosoft.com/cgi-bin/cvsweb.cgi/cm3/m3-sys/m3cc/src/platforms.quake. 
 We should error clearly for what you did. 


See also m3-sys/m3middle/src/Target.i3 and Target.m3.

And for that matter.

 grep -r -i linux m3makefile *quake*  


or such. The only occurences are likely in m3core and libm3.

But in general, missing support is supposed to error clearly.
Even for what you did. Odd.


http://modula3.elegosoft.com/cgi-bin/cvsweb.cgi/cm3/m3-sys/m3cc/src/m3makefile?rev=1.241;content-type=text%2Fplain

readonly proc GNU_platform (x) is
  if Platform_info contains x
    return Platform_info{x}
  else
    error ("GNU platform is not known for \"" & x & "\"")
    return "unknown-unknown-unknown"
  end
end

I'm curious to see the start of the m3cc build -- it didn't error?

This platform list is unfortunate, in that the information is duplicated here and in each target's configuration file.
Ideally that wouldn't be the case.


Are you running Linux 2.4 or 2.6?
I was running "Tomato" on my MIPS router, and it was 2.4.
This might be a small problem.
Linux has had pthreads since long before 2.6/NPTL, but we didn't use them, and don't know if they work adequately.
User threads ought to work, if get/set/make/swapcontext are in 2.4.


I strongly suggest we introduce an alternate target, MIPS32_LINUX_USERTHREADS or MIPS32EL_LINUX_USERTHREADS or MIPSEL_LINUX_USERTHREADS. That is, I suggest "userthreads" be part of the target name. Or somesuch. Granted, people won't know what it means if they should pick it, and it might sound "good" to people and they'd pick it accidentally.
Perhaps you should just hack m3core/.../m3makefile yourself to build for this platform. But that seems a bit gross.


Maybe MIPSEL_LINUX24?



 - Jay


> To: m3devel at elegosoft.com
> Date: Fri, 4 Nov 2011 00:30:10 -0700
> From: mika at async.caltech.edu
> Subject: [M3devel] adding new target?
> 
> Hi Jay,
> 
> I know you have mentioned before that it's now "easy" to add a new target.
> I would like to add a target that is already mostly there, I think.
> The one I want is mipsel-linux.  This is to run on an Asus RT-N16 router
> running OpenWRT or DD-WRT.  These devices have 500 MHz MIPS processors
> and 128 MB of DRAM.
> 
> First before you read this email, are there any instructions for what
> I'm trying to do anywhere, beyond your emails?  I am using boot1.py
> as you suggested.
> 
> What I did was the following (guesses all along):
> 
> made a cm3.cfg which I called MIPSEL_LINUX and put in 
> m3-sys/cminstall/src/config-no-install:
> 
> ::::
> readonly TARGET = "MIPSEL_LINUX" % code generation target
> readonly GNU_PLATFORM = "mipsel-linux" % "cpu-os" string for GNU
> 
> SYSTEM_CC = "gcc -gstabs+ -fPIC" % C compiler
> SYSTEM_ASM = "as" % Assembler
> 
> m3back_m32 = "" % -m32 not allowed
> 
> include("MIPSEL.common")
> include("Linux.common")
> ::::
> 
> where MIPSEL.common contains:
> 
> ::::
> 
> readonly TARGET_ARCH = "MIPS"
> readonly TARGET_ENDIAN = "LITTLE"   % { "BIG" OR "LITTLE" }
> readonly WORD_SIZE    = "32BITS"    % { "32BITS" or "64BITS" }
> 
> ::::
> 
> Now I don't really know which of these strings are just arbitrary
> strings that I'm defining here and which of them have to match
> other things (and if so, what they have to match).
> 
> In any case I'm doing something wrong because I do (on a FreeBSD4
> machine)...
> 
> ./boot1.py MIPSEL_LINUX
> 
> which runs for a bit and eventually degenerates to
> 
> gmake[1]: Nothing to be done for `all'.
> gmake[1]: Leaving directory `/big/home2/mika/2/cm3-cvs/cm3/m3-sys/m3cc/FreeBSD4-I386_FREEBSD/libdecnumber'
> cd ../FreeBSD4-I386_FREEBSD && cd libcpp && gmake  CFLAGS="-g -O2"   MAKE=gmake  AUTOCONF=: AUTOMAKE=: LEX='touch lex.yy.c' MAKEINFO=: libcpp.a |  tee -a
>  /big/home2/mika/2/cm3-cvs/cm3/m3-sys/m3cc/src/../FreeBSD4-I386_FREEBSD/_m3.log
> cd ../FreeBSD4-I386_FREEBSD && cd libcpp && gmake  CFLAGS="-g -O2"   MAKE=gmake  AUTOCONF=: AUTOMAKE=: LEX='touch lex.yy.c' MAKEINFO=: libcpp.a |  tee -a
>  /big/home2/mika/2/cm3-cvs/cm3/m3-sys/m3cc/src/../FreeBSD4-I386_FREEBSD/_m3.log
> gmake: `libcpp.a' is up to date.
> cd ../FreeBSD4-I386_FREEBSD && cd gcc && gmake  CFLAGS="-g -O2"   MAKE=gmake  AUTOCONF=: AUTOMAKE=: LEX='touch lex.yy.c' MAKEINFO=: s-modes insn-config.h
>  m3cg | tee -a /big/home2/mika/2/cm3-cvs/cm3/m3-sys/m3cc/src/../FreeBSD4-I386_FREEBSD/_m3.log
> cd ../FreeBSD4-I386_FREEBSD && cd gcc && gmake  CFLAGS="-g -O2"   MAKE=gmake  AUTOCONF=: AUTOMAKE=: LEX='touch lex.yy.c' MAKEINFO=: s-modes insn-config.h
>  m3cg | tee -a /big/home2/mika/2/cm3-cvs/cm3/m3-sys/m3cc/src/../FreeBSD4-I386_FREEBSD/_m3.log
> gmake: `s-modes' is up to date.
> gmake: `insn-config.h' is up to date.
> gmake: Nothing to be done for `m3cg'.
> --- building in FreeBSD4 ---
> 
> new source -> compiling RTHooks.i3
> ../src/runtime/common/RTHooks.i3:15: fatal error:  *** illegal type: 0x6f, at m3cg_lineno 5
> compilation terminated.
>   m3_backend => 1
> m3cc (aka cm3cg) failed compiling: RTHooks.ic
> new source -> compiling RT0.i3
> ../src/runtime/common/RT0.i3:19: fatal error:  *** illegal type: 0x6f, at m3cg_lineno 5
> compilation terminated.
>   m3_backend => 1
> m3cc (aka cm3cg) failed compiling: RT0.ic
> new source -> compiling RuntimeError.i3
> ../src/runtime/common/RuntimeError.i3:10: fatal error:  *** illegal type: 0x6f, at m3cg_lineno 5
> compilation terminated.
>   m3_backend => 1
> ...
> 
>     Mika
> 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20111104/1ff21749/attachment-0002.html>


More information about the M3devel mailing list