From 56b2ba5e7da6eed01755d70dcd7fe2e1b19e429f Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Wed, 4 Dec 2019 11:53:46 -0500 Subject: Fix building of BSPs in different source directories than their name. Also fix missing include directory required by beagle for the testsuite. --- bsps/arm/beagle/py/bsp.py | 4 ++-- bsps/arm/beagle/wscript | 8 ++++++++ bsps/wscript | 2 +- py/waf/tools.py | 1 + py/waf/waf.py | 3 ++- testsuites/fstests/wscript | 4 ++-- testsuites/psxtests/wscript | 2 +- testsuites/psxtmtests/wscript | 2 +- testsuites/sptests/wscript | 8 ++++---- testsuites/tmtests/wscript | 2 +- testsuites/wscript | 8 ++++---- 11 files changed, 27 insertions(+), 17 deletions(-) diff --git a/bsps/arm/beagle/py/bsp.py b/bsps/arm/beagle/py/bsp.py index e6003cd8ce..25b44195d6 100644 --- a/bsps/arm/beagle/py/bsp.py +++ b/bsps/arm/beagle/py/bsp.py @@ -7,9 +7,9 @@ class BSP(Base): def build(self, c): c.CFLAGS = ['-mcpu=cortex-a8'] - c.LINKCMDS = ['arm/beagle/start/linkcmds.beagle', 'arm/shared/start/linkcmds.armv4', 'arm/shared/start/linkcmds.base'] + c.LINKCMDS = ['arm/beagle/start/linkcmds', 'arm/shared/start/linkcmds.armv4', 'arm/shared/start/linkcmds.base'] # c.LINKCMDS = ['src/lib/libbsp/arm/beagle/startup/linkcmds.beagle', 'src/lib/libbsp/arm/shared/startup/linkcmds.armv4', 'src/lib/libbsp/arm/shared/startup/linkcmds.base'] - c.BSP_SOURCE_DIR = "beagle" + c.BSP_SOURCE_DIR = self.bsp_source_dir def header(self, c): c.CONSOLE_USE_INTERRUPTS = False diff --git a/bsps/arm/beagle/wscript b/bsps/arm/beagle/wscript index 7452a4d26f..77b8718570 100644 --- a/bsps/arm/beagle/wscript +++ b/bsps/arm/beagle/wscript @@ -51,8 +51,16 @@ def build(ctx): # Cache # "../shared/cache/cache-cp15.c", + +# Debug + "start/bspdebug.c", + ] +# if ctx.env.RTEMS_BSP in ["beagleboardorig"]: +# source += ["start/bspdebug.c"] + + ctx.bsp.start(["../shared/start/start.S"]) ctx.bsp.source( diff --git a/bsps/wscript b/bsps/wscript index 8630435bfc..7afe307f9b 100644 --- a/bsps/wscript +++ b/bsps/wscript @@ -7,7 +7,7 @@ def build(ctx): ctx.recurse("shared") ctx.recurse("%s/shared" % ctx.env.RTEMS_ARCH) - ctx.recurse("%s/%s" % (ctx.env.RTEMS_ARCH, ctx.env.RTEMS_BSP)) + ctx.recurse("%s/%s" % (ctx.env.RTEMS_ARCH, ctx.env.BSP_SOURCE_DIR)) ctx( diff --git a/py/waf/tools.py b/py/waf/tools.py index 9e6a415319..f08f3bcbc1 100644 --- a/py/waf/tools.py +++ b/py/waf/tools.py @@ -44,6 +44,7 @@ def generate_rtems_config(ctx, file_in, file_out, devel=False): ldflags.append("-specs %s/gcc_spec" % path_bld) ldflags.append("-L%s/cpukit/" % path_bld) ldflags.append("-L%s/c/" % path_bld) + ldflags.append("-L%s/bsps/arm/beagle/" % path_bld) # ldflags.append("-Wl,-T %s/c/linkcmds" % path_bld) # bsps[bsp]["ldflags"] = ldflags + bsps[bsp]["libs"] bsps[bsp]["ldflags"] += ldflags + ["-Wl,-start-group"] + bsps[bsp]["libs"] + ["-lc"] + ["-lgcc"] + ["-Wl,-end-group"] diff --git a/py/waf/waf.py b/py/waf/waf.py index 3988dbf5cb..498120cda4 100644 --- a/py/waf/waf.py +++ b/py/waf/waf.py @@ -354,6 +354,7 @@ def re_fix_linkcmds(self): linkcmds = self.env.LINKCMDS[0] assert linkcmds assert self.link_task + for x in ('linkcmds_linkcmds', 'linkcmds_base', 'start_start_o'): tg = self.bld.get_tgen_by_name(x) tg.post() @@ -367,7 +368,7 @@ USELIB_VARS['test_cprogram'] = set(['STLIB', 'STLIBPATH', 'LDFLAGS']) #from StringIO import StringIO from os import fdopen, pipe, read, close class test_cprogram(cprogram): - run_str = '${LINK_CC} ${LDFLAGS} ${CFLAGS} ${CCLNK_SRC_F}${SRC} ${CCLNK_TGT_F}${TGT[0].abspath()} -specs gcc_spec -Wl,-Bstatic -Lc -Lcpukit -Wl,-start-group -lc -lgcc ${STLIBPATH_ST:STLIBPATH} ${STLIB_ST:STLIB} -Wl,-end-group' + run_str = '${LINK_CC} ${LDFLAGS} ${CFLAGS} ${CCLNK_SRC_F}${SRC} ${CCLNK_TGT_F}${TGT[0].abspath()} -specs gcc_spec -Wl,-Bstatic -Lc -Lcpukit -Lbsps/${RTEMS_ARCH}/${BSP_SOURCE_DIR} -Wl,-start-group -lc -lgcc ${STLIBPATH_ST:STLIBPATH} ${STLIB_ST:STLIB} -Wl,-end-group' def exec_command(self, cmd, **kw): r, w = pipe() diff --git a/testsuites/fstests/wscript b/testsuites/fstests/wscript index ab8cea1932..4cc6c94060 100644 --- a/testsuites/fstests/wscript +++ b/testsuites/fstests/wscript @@ -13,7 +13,7 @@ def build(ctx): source, includes = includes_common + includes, use = use, - features = "src_include_rtems src_include_score src_include_bsp src_include_bsp_common" + features = "src_include_rtems src_include_score src_include_bsp src_include_bsp_common src_include_bsp_arch" ) def objects_common(target, source): @@ -21,7 +21,7 @@ def build(ctx): source = source, name = "fstests_%s_common" % target, includes = ["%s/testsuites/fstests/%s_support" % (srcnode, target)] + includes_common, - features = "bld_include src_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common" + features = "bld_include src_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common src_include_bsp_arch" ) diff --git a/testsuites/psxtests/wscript b/testsuites/psxtests/wscript index a186ed359b..3c56a2ad9c 100644 --- a/testsuites/psxtests/wscript +++ b/testsuites/psxtests/wscript @@ -14,7 +14,7 @@ def build(ctx): includes = [ "%s/testsuites/psxtests/include/" % srcnode, ] + includes_merge, - features = "test_include src_include_score src_include_bsp src_include_bsp_common", + features = "test_include src_include_score src_include_bsp src_include_bsp_common src_include_bsp_arch", **kwarg ) diff --git a/testsuites/psxtmtests/wscript b/testsuites/psxtmtests/wscript index 06214e9591..3ef4831efe 100644 --- a/testsuites/psxtmtests/wscript +++ b/testsuites/psxtmtests/wscript @@ -14,7 +14,7 @@ def build(ctx): includes = [ "%s/testsuites/tmtests/include/" % srcnode, ] + includes_merge, - features = "test_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common", + features = "test_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common src_include_bsp_arch", **kwarg ) diff --git a/testsuites/sptests/wscript b/testsuites/sptests/wscript index d7628bb721..5a7a808eb7 100644 --- a/testsuites/sptests/wscript +++ b/testsuites/sptests/wscript @@ -3,7 +3,7 @@ def build(ctx): ctx.rtems_test( "sptests_%s" % target, source, - features = "test_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common", + features = "test_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common src_include_bsp_arch", **kwarg ) @@ -102,7 +102,7 @@ def build(ctx): "%s/testsuites/support/include" % ctx.srcnode.abspath(), "%s/testsuites/sptests/%s" % (ctx.srcnode.abspath(), target) ], - features = "src_include_rtems src_include_score src_include_bsp src_include_bsp_common", + features = "src_include_rtems src_include_score src_include_bsp src_include_bsp_common src_include_bsp_arch", use="test_sptests_spfatal_support" ) @@ -144,7 +144,7 @@ def build(ctx): "%s/testsuites/support/include" % ctx.srcnode.abspath(), "%s/testsuites/sptests/spintrcritical_support" % ctx.srcnode.abspath() ], - features = "bld_include src_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common" + features = "bld_include src_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common src_include_bsp_arch" ) def spincritical(target, source, **kwargs): @@ -154,7 +154,7 @@ def build(ctx): includes = [ "%s/testsuites/sptests/spintrcritical_support" % ctx.srcnode.abspath() ], - features = "test_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common", + features = "test_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common src_include_bsp_arch", use="test_sptests_spintrcritical_support", **kwargs ) diff --git a/testsuites/tmtests/wscript b/testsuites/tmtests/wscript index ee2e11c4ae..608810435f 100644 --- a/testsuites/tmtests/wscript +++ b/testsuites/tmtests/wscript @@ -8,7 +8,7 @@ def build(ctx): "%s/testsuites/tmtests/include/" % ctx.srcnode.abspath(), "%s/testsuites/support/include/" % ctx.srcnode.abspath(), ], - features = "src_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common" + features = "src_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common src_include_bsp_arch" ) test("tmck", "tmck/task1.c") diff --git a/testsuites/wscript b/testsuites/wscript index c3ebff5f15..6bb13ca484 100644 --- a/testsuites/wscript +++ b/testsuites/wscript @@ -12,27 +12,27 @@ def build(ctx): source = ["support/src/spin.c"], name = "test_support_spin", includes = ["%s/testsuites/support/include/" % srcnode], #XXX: why was this added in ac165341 - features = "bld_include src_include src_include_rtems src_include_score" + features = "bld_include src_include src_include_rtems src_include_score src_include_bsp_arch" ) ctx.objects( source = ["support/src/test_support.c"], name = "test_support", - features = "bld_include src_include test_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common" + features = "bld_include src_include test_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common src_include_bsp_arch" ) ctx.objects( source = ["support/src/tmtests_support.c"], name = "test_support_tmtests", includes = ["%s/testsuites/tmtests/include/" % srcnode], - features = "bld_include src_include test_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common" + features = "bld_include src_include test_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common src_include_bsp_arch" ) if ctx.env.ENABLE_SMP and ctx.env.BSP[0] in ["sparc/leon3", "i386/pc386"]: ctx.objects( source = ["support/src/locked_print.c"], name = "test_support_locked_print", - features = "bld_include src_include test_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common" + features = "bld_include src_include test_include src_include_rtems src_include_score src_include_bsp src_include_bsp_common src_include_bsp_arch" ) ctx.recurse("fstests") -- cgit v1.2.3