diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-01-17 17:42:31 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-01-17 17:42:31 +0000 |
commit | ec669a14ab680da475cd1e16b588f164462c0d78 (patch) | |
tree | 89d07e330ae0930f79128aa69929c0461a276eef /nuttx/configs | |
parent | 7067857b49223d259878a3c479f05d7e1bd2b19f (diff) | |
download | px4-nuttx-ec669a14ab680da475cd1e16b588f164462c0d78.tar.gz px4-nuttx-ec669a14ab680da475cd1e16b588f164462c0d78.tar.bz2 px4-nuttx-ec669a14ab680da475cd1e16b588f164462c0d78.zip |
Add support for building 32-bit simulation on a 64-bit target
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4307 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs')
-rw-r--r-- | nuttx/configs/sim/README.txt | 11 | ||||
-rw-r--r-- | nuttx/configs/sim/mount/Make.defs | 23 | ||||
-rw-r--r-- | nuttx/configs/sim/nettest/Make.defs | 23 | ||||
-rw-r--r-- | nuttx/configs/sim/nsh/Make.defs | 23 | ||||
-rw-r--r-- | nuttx/configs/sim/nsh2/Make.defs | 23 | ||||
-rw-r--r-- | nuttx/configs/sim/nx/Make.defs | 23 | ||||
-rw-r--r-- | nuttx/configs/sim/nxffs/Make.defs | 23 | ||||
-rw-r--r-- | nuttx/configs/sim/ostest/Make.defs | 23 | ||||
-rw-r--r-- | nuttx/configs/sim/pashello/Make.defs | 24 |
9 files changed, 169 insertions, 27 deletions
diff --git a/nuttx/configs/sim/README.txt b/nuttx/configs/sim/README.txt index b5c057e05..c7005271c 100644 --- a/nuttx/configs/sim/README.txt +++ b/nuttx/configs/sim/README.txt @@ -97,10 +97,15 @@ addresses should not be retained in uint32_t types but rather in uintptr_t types to avoid issues just like this. The workaround on 64-bit machines for now is to build for a 32-bit target on the -64-bit machine. This workaround involves modifying the Make.defs file in the +64-bit machine. The workaround for this issue has been included in NuttX 6.15 and +beyond. For thoses versions, you must add CONFIG_SIM_M32=y to the .config file in +order to enable building a 32-bit image on a 64-bit platform. + +For older versions of NuttX, a patch also exists. The patch the Make.defs file in the appropriate places so that -m32 is included in the CFLAGS and -m32 and -melf_386 -are included in the LDFLAGS. See the patch 0001-Quick-hacks-to-build-sim-nsh-ostest-on-x86_64-as-32-.patch -that can be found at http://tech.groups.yahoo.com/group/nuttx/files. +are included in the LDFLAGS. See the patch +0001-Quick-hacks-to-build-sim-nsh-ostest-on-x86_64-as-32-.patch that can be found at +http://tech.groups.yahoo.com/group/nuttx/files. Stack Size Issues ----------------- diff --git a/nuttx/configs/sim/mount/Make.defs b/nuttx/configs/sim/mount/Make.defs index 498291077..e3e1a8576 100644 --- a/nuttx/configs/sim/mount/Make.defs +++ b/nuttx/configs/sim/mount/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # configs/sim/mount/Make.defs # -# Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved. +# Copyright (C) 2008, 2011-2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt <gnutt@nuttx.org> # # Redistribution and use in source and binary forms, with or without @@ -53,6 +53,11 @@ ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx ARCHSCRIPT = +ifeq ($(CONFIG_SIM_M32),y) + ARCHCPUFLAGS += -m32 + ARCHCPUFLAGSXX += -m32 +endif + CROSSDEV = CC = $(CROSSDEV)gcc CXX = $(CROSSDEV)g++ @@ -79,8 +84,20 @@ else EXEEXT = endif -ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") - LDFLAGS += -g +LDLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(LD) +CCLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(CC) +LDFLAGS = $(ARCHSCRIPT) # For backward compatibility, same as CCLINKFLAGS + +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) + LDLINKFLAGS += -g + CCLINKFLAGS += -g + LDFLAGS += -g +endif + +ifeq ($(CONFIG_SIM_M32),y) + LDLINKFLAGS += -melf_i386 + CCLINKFLAGS += -m32 + LDFLAGS += -m32 endif define PREPROCESS diff --git a/nuttx/configs/sim/nettest/Make.defs b/nuttx/configs/sim/nettest/Make.defs index cf0134b9b..a1052492a 100644 --- a/nuttx/configs/sim/nettest/Make.defs +++ b/nuttx/configs/sim/nettest/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # configs/sim/Make.defs # -# Copyright (C) 2007-2008, 2011 Gregory Nutt. All rights reserved. +# Copyright (C) 2007-2008, 2011-2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt <gnutt@nuttx.org> # # Redistribution and use in source and binary forms, with or without @@ -53,6 +53,11 @@ ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx ARCHSCRIPT = +ifeq ($(CONFIG_SIM_M32),y) + ARCHCPUFLAGS += -m32 + ARCHCPUFLAGSXX += -m32 +endif + CROSSDEV = CC = $(CROSSDEV)gcc CXX = $(CROSSDEV)g++ @@ -79,8 +84,20 @@ else EXEEXT = endif -ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") - LDFLAGS += -g +LDLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(LD) +CCLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(CC) +LDFLAGS = $(ARCHSCRIPT) # For backward compatibility, same as CCLINKFLAGS + +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) + LDLINKFLAGS += -g + CCLINKFLAGS += -g + LDFLAGS += -g +endif + +ifeq ($(CONFIG_SIM_M32),y) + LDLINKFLAGS += -melf_i386 + CCLINKFLAGS += -m32 + LDFLAGS += -m32 endif define PREPROCESS diff --git a/nuttx/configs/sim/nsh/Make.defs b/nuttx/configs/sim/nsh/Make.defs index 1330ade1e..83bc35d76 100644 --- a/nuttx/configs/sim/nsh/Make.defs +++ b/nuttx/configs/sim/nsh/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # configs/sim/nsh/Make.defs # -# Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved. +# Copyright (C) 2008, 2011-2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt <gnutt@nuttx.org> # # Redistribution and use in source and binary forms, with or without @@ -53,6 +53,11 @@ ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx ARCHSCRIPT = +ifeq ($(CONFIG_SIM_M32),y) + ARCHCPUFLAGS += -m32 + ARCHCPUFLAGSXX += -m32 +endif + CROSSDEV = CC = $(CROSSDEV)gcc CXX = $(CROSSDEV)g++ @@ -79,8 +84,20 @@ else EXEEXT = endif -ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") - LDFLAGS += -g +LDLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(LD) +CCLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(CC) +LDFLAGS = $(ARCHSCRIPT) # For backward compatibility, same as CCLINKFLAGS + +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) + LDLINKFLAGS += -g + CCLINKFLAGS += -g + LDFLAGS += -g +endif + +ifeq ($(CONFIG_SIM_M32),y) + LDLINKFLAGS += -melf_i386 + CCLINKFLAGS += -m32 + LDFLAGS += -m32 endif define PREPROCESS diff --git a/nuttx/configs/sim/nsh2/Make.defs b/nuttx/configs/sim/nsh2/Make.defs index 39b33dc7d..7fba83b72 100644 --- a/nuttx/configs/sim/nsh2/Make.defs +++ b/nuttx/configs/sim/nsh2/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # configs/sim/nsh2/Make.defs # -# Copyright (C) Gregory Nutt. All rights reserved. +# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt <gnutt@nuttx.org> # # Redistribution and use in source and binary forms, with or without @@ -54,6 +54,11 @@ ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx ARCHSCRIPT = +ifeq ($(CONFIG_SIM_M32),y) + ARCHCPUFLAGS += -m32 + ARCHCPUFLAGSXX += -m32 +endif + CROSSDEV = CC = $(CROSSDEV)gcc CXX = $(CROSSDEV)g++ @@ -80,8 +85,20 @@ else EXEEXT = endif -ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") - LDFLAGS += -g +LDLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(LD) +CCLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(CC) +LDFLAGS = $(ARCHSCRIPT) # For backward compatibility, same as CCLINKFLAGS + +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) + LDLINKFLAGS += -g + CCLINKFLAGS += -g + LDFLAGS += -g +endif + +ifeq ($(CONFIG_SIM_M32),y) + LDLINKFLAGS += -melf_i386 + CCLINKFLAGS += -m32 + LDFLAGS += -m32 endif define PREPROCESS diff --git a/nuttx/configs/sim/nx/Make.defs b/nuttx/configs/sim/nx/Make.defs index 70f6066e1..91e42aced 100644 --- a/nuttx/configs/sim/nx/Make.defs +++ b/nuttx/configs/sim/nx/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # configs/sim/nx/Make.defs # -# Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved. +# Copyright (C) 2008, 2011-2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt <gnutt@nuttx.org> # # Redistribution and use in source and binary forms, with or without @@ -53,6 +53,11 @@ ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx ARCHSCRIPT = +ifeq ($(CONFIG_SIM_M32),y) + ARCHCPUFLAGS += -m32 + ARCHCPUFLAGSXX += -m32 +endif + CROSSDEV = CC = $(CROSSDEV)gcc CXX = $(CROSSDEV)g++ @@ -79,8 +84,20 @@ else EXEEXT = endif -ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") - LDFLAGS += -g +LDLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(LD) +CCLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(CC) +LDFLAGS = $(ARCHSCRIPT) # For backward compatibility, same as CCLINKFLAGS + +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) + LDLINKFLAGS += -g + CCLINKFLAGS += -g + LDFLAGS += -g +endif + +ifeq ($(CONFIG_SIM_M32),y) + LDLINKFLAGS += -melf_i386 + CCLINKFLAGS += -m32 + LDFLAGS += -m32 endif define PREPROCESS diff --git a/nuttx/configs/sim/nxffs/Make.defs b/nuttx/configs/sim/nxffs/Make.defs index 9010d2bb4..e7d5b6d50 100644 --- a/nuttx/configs/sim/nxffs/Make.defs +++ b/nuttx/configs/sim/nxffs/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # configs/sim/nxffs/Make.defs # -# Copyright (C) 2011 Gregory Nutt. All rights reserved. +# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt <gnutt@nuttx.org> # # Redistribution and use in source and binary forms, with or without @@ -53,6 +53,11 @@ ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx ARCHSCRIPT = +ifeq ($(CONFIG_SIM_M32),y) + ARCHCPUFLAGS += -m32 + ARCHCPUFLAGSXX += -m32 +endif + CROSSDEV = CC = $(CROSSDEV)gcc CXX = $(CROSSDEV)g++ @@ -79,8 +84,20 @@ else EXEEXT = endif -ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") - LDFLAGS += -g +LDLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(LD) +CCLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(CC) +LDFLAGS = $(ARCHSCRIPT) # For backward compatibility, same as CCLINKFLAGS + +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) + LDLINKFLAGS += -g + CCLINKFLAGS += -g + LDFLAGS += -g +endif + +ifeq ($(CONFIG_SIM_M32),y) + LDLINKFLAGS += -melf_i386 + CCLINKFLAGS += -m32 + LDFLAGS += -m32 endif define PREPROCESS diff --git a/nuttx/configs/sim/ostest/Make.defs b/nuttx/configs/sim/ostest/Make.defs index cf0134b9b..a1052492a 100644 --- a/nuttx/configs/sim/ostest/Make.defs +++ b/nuttx/configs/sim/ostest/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # configs/sim/Make.defs # -# Copyright (C) 2007-2008, 2011 Gregory Nutt. All rights reserved. +# Copyright (C) 2007-2008, 2011-2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt <gnutt@nuttx.org> # # Redistribution and use in source and binary forms, with or without @@ -53,6 +53,11 @@ ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx ARCHSCRIPT = +ifeq ($(CONFIG_SIM_M32),y) + ARCHCPUFLAGS += -m32 + ARCHCPUFLAGSXX += -m32 +endif + CROSSDEV = CC = $(CROSSDEV)gcc CXX = $(CROSSDEV)g++ @@ -79,8 +84,20 @@ else EXEEXT = endif -ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") - LDFLAGS += -g +LDLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(LD) +CCLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(CC) +LDFLAGS = $(ARCHSCRIPT) # For backward compatibility, same as CCLINKFLAGS + +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) + LDLINKFLAGS += -g + CCLINKFLAGS += -g + LDFLAGS += -g +endif + +ifeq ($(CONFIG_SIM_M32),y) + LDLINKFLAGS += -melf_i386 + CCLINKFLAGS += -m32 + LDFLAGS += -m32 endif define PREPROCESS diff --git a/nuttx/configs/sim/pashello/Make.defs b/nuttx/configs/sim/pashello/Make.defs index 40dc5acb1..6f662adc0 100644 --- a/nuttx/configs/sim/pashello/Make.defs +++ b/nuttx/configs/sim/pashello/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # configs/sim/pashello/Make.defs # -# Copyright (C) 2007-2008, 2011 Gregory Nutt. All rights reserved. +# Copyright (C) 2007-2008, 2011-2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt <gnutt@nuttx.org> # # Redistribution and use in source and binary forms, with or without @@ -53,6 +53,11 @@ ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx ARCHSCRIPT = +ifeq ($(CONFIG_SIM_M32),y) + ARCHCPUFLAGS += -m32 + ARCHCPUFLAGSXX += -m32 +endif + CROSSDEV = CC = $(CROSSDEV)gcc CXX = $(CROSSDEV)g++ @@ -79,9 +84,22 @@ else EXEEXT = endif -ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") - LDFLAGS += -g +LDLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(LD) +CCLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(CC) +LDFLAGS = $(ARCHSCRIPT) # For backward compatibility, same as CCLINKFLAGS + +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) + LDLINKFLAGS += -g + CCLINKFLAGS += -g + LDFLAGS += -g endif + +ifeq ($(CONFIG_SIM_M32),y) + LDLINKFLAGS += -melf_i386 + CCLINKFLAGS += -m32 + LDFLAGS += -m32 +endif + EXTRA_LIBS = -lm define PREPROCESS |