NetSurf Build System / Atari support

Ole ole at
Mon Apr 15 23:20:36 BST 2013


 It looks like the current netsurf buildsystem isn't able to compile
 correct executables for the atari target, this is especially bad when 
 on coldfire, where the build failure results in illegal instructions
 (when m68k CPU emulation is turned off).
 (the sdk build maybe suffers the same problem, but that's another 

 On my local box I use Verbose mode of make, to see the actual compiler 

 Let's have a look at the atari support within the netsurf buildsystem:

 --- snip ---

 # FreeMiNT / atari
 ifeq ($(TARGET),atari)
   ifeq ($(HOST),atari)
     # Building on FreeMiNT
     # Nothing to do, as we assume the default tooling works
     # Cross compiling for FreeMiNT

     ATARIARCH ?= 68020-60

     GCCSDK_INSTALL_ENV ?= /opt/netsurf/m68k-atari-mint
     GCCSDK_INSTALL_CROSSBIN ?= /opt/netsurf/m68k-atari-mint/cross/bin
     CC__ := $(GCCSDK_INSTALL_CROSSBIN)/m68k-atari-mint-gcc
     CXX__ := $(GCCSDK_INSTALL_CROSSBIN)/m68k-atari-mint-g++
     AR__ := $(GCCSDK_INSTALL_CROSSBIN)/m68k-atari-mint-ar

     ifeq ($(ATARIARCH),68000)
        ARCHFLAGS :=
        ARCHDIR :=
     ifeq ($(ATARIARCH),68020-60)
        ARCHDIR := /$(ATARIARCH)
     ifeq ($(ATARIARCH),v4e)
        ARCHFLAGS := -mcpu=5475
        ARCHDIR := /m5475



 --- snip ---

 First thing to notice is the fact that it assumes you do pass the 
 environment variable ATARIARCH
 to specify the CPU type. If you do not specify this variable, the cpu 
 defaults to 68020-60, which
 is definitly wrong for coldfire compilation.

 I'm assuming that the netsurf build system does not set ATARIARCH.
 I'm open for suggestions, how to specify and resolve the CPU type 
 differently, of course.

 Also look at the output of libcss build:,label=other/86/consoleText

 You can not see which compiler was used. You can not see which 
 CFLAGS/LDFLAGS where used.

 Second thing to notice is the fact that it assumes the m68k-atari-mint 
 toolchain to be used:
     CC__ := $(GCCSDK_INSTALL_CROSSBIN)/m68k-atari-mint-gcc
     CXX__ := $(GCCSDK_INSTALL_CROSSBIN)/m68k-atari-mint-g++
     AR__ := $(GCCSDK_INSTALL_CROSSBIN)/m68k-atari-mint-ar

 When compiling for coldfire (the way it was meant to be: by setting 
 ATARIARCH) it will fail to find the compiler
 because the m68k-atari-mint compiler is not located in the coldfire sdk 

 Of course the script could be adjusted like this:
     ifeq ($(ATARIARCH),v4e)
        ARCHFLAGS := -mcpu=5475
        ARCHDIR := /m5475
        CC__ := $(GCCSDK_INSTALL_CROSSBIN)/m5475-atari-mint-gcc
        CXX__ := $(GCCSDK_INSTALL_CROSSBIN)/m5475-atari-mint-g++
        AR__ := $(GCCSDK_INSTALL_CROSSBIN)/m5475-atari-mint-ar

 But that would mean, that the average buildsystem user is not able to 
 compile netsurf
 on his own box, when he doesn't want to use the m5475-atari-mint-xxx 
 provided by the netsurf sdk build.

 As an example, just take this simple make command and see how it fails:

 GCCSDK_INSTALL_ENV=/opt/netsurf/m5475-atari-mint make TARGET=atari 
 /bin/sh: /opt/netsurf/m5475-atari-mint/cross/bin/m68k-atari-mint-gcc: 
 not found
 /bin/sh: /opt/netsurf/m5475-atari-mint/cross/bin/m68k-atari-mint-gcc: 
 not found
 *** Unable to detect toolchain.  Schluss.
 Using m68k-atari-mint-gcc to compile atari coldfire software is de 
 facto standard and
 I don't want to explain people that things are different with netsurf 
 However, if this is the only way to implement clean coldfire support in 
 the netsurf
 buildsystem, I'm happy to take that pill.

 Can we add the ATARIARCH environment variable, like it is done for the 
 netsurf build?
 Valid values:

 The coldfire build will be broken then (look at the example above), 
 because it won't be able to find the toolchain (except it is explicitly 
 set), however, when that happens, I probably already fixed the toolchain 
 names for coldfire within the makefile.

More information about the netsurf-dev mailing list