[Top][All Lists]

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

Re: Assistance Request

From: Joel Sherrill
Subject: Re: Assistance Request
Date: Tue, 12 Feb 2008 09:00:19 -0600
User-agent: Thunderbird (X11/20071115)

Dave Korn wrote:
On 11 February 2008 21:29, Joel Sherrill wrote:

We use versioned target names.  Do I have to list them all in
the following section?

# This is a list of toolchains that are supported on this board.
set_board_info target_install {powerpc-rtems4.9}

  I don't know for a fact, I've never tried it, but I'd guess...

runtest.exp:        if { [lsearch -exact $target_install $target_alias] >= 0 }

.. you need to explicitly enumerate them.  (There might be a good argument for
making that --glob or even --regex).

What about arguments to the simulator?  As you can see in
the example, we use this to invoke powerpc-rtems-run:


where DEVICE_TREE_FILE has the device configuration.  How does
that get passed through?  Where should the DEVICE_TREE_FILE

  I handle that - and this works for me because, like your case, the
EXECUTABLE is last on the commandline - by doing the equivalent of

set_board_info sim "RUN -f DEVICE_TREE_FILE"

and the EXECUTABLE gets appended by proc sim_spawn.  (Looking at that, it
seems there is some way of specifying the sim and the flags separately by

set_board_info sim "RUN"
set_board_info sim,flags "-f DEVICE_TREE_FILE"

but I have never tried it myself.)

+ an extra object file to link with.

set_board_info ldflags

Do I custom compile testrun.c myself? Or is that automatic?
For sure we need the main() wrapper for no return code.  I
can have the application start at main() so that isn't an issue.

  There's a thing called

set_board_info needs_status_wrapper 1

which I forget how it works, but that's one way to make it work.  In my case,
I've added a flag to my simulator so that the sim itself returns the exit
status of the executable (and detects if the simulated app hits abort() or
exit() at the same time, I have no runtime library to speak of).

I assume I have to manually compile an rtems specific support
file before the tests are run right?

  If the needs_status_wrapper stuff doesn't do what you want, I think - again,
untested - you could probably invoke the compiler from your baseboard script.
Don't really know about this one though.

+ target CFLAGS and LDFLAGS

set_board_info cflags
set_board_info ldflags

As you can hopefully see now, we need to generically do this:

-B ${prefix}/${target}/BSP/ -specs bsp_specs -qrtems CPU_CFLAGS

where each board has its own CPU_CFLAGS. For psim, it would be
something like this when fully expanded:

-B/home/joel/rtems-4.9-work/bsp-install//powerpc-rtems4.9/psim/lib/ \
    -specs bsp_specs -qrtems -mcpu=603e  -Dppc603e

I hate to hard-code a path or target since it is versioned.  Are there
DejaGNU variables I can use?

  I pass external environment vars into the script by using


then I can use the value of MY_SCRIPT_VAR in the various set_board_info flags;
that should do for getting things like prefix and target into your flags.

  So, how far are you at?  Have you got a baseboard script written yet?
Have you read the "Extending DejaGnu" chapter of the manual, specifically
the "Adding a new board" section?

I'm hacking on that.  But am not comfortable with this and
still don't know how to invoke runtest properly. :)

  I always use

make -k check RUNTESTFLAGS="... whatever ..."

and don't bother trying to invoke it directly.  (Can replace "check" by
"check-gcc" if you want to skip the mangler tests etc.)

I have this now to run it:

make check-gcc RUNTESTFLAGS="\
RTEMS_MAKEFILE_PATH=/home/joel/work-gnat/423/bsp-install/powerpc-rtems4.9/psim/ \
 --target=rtems-powerpc-sim --all \

I got executables but they are not linking in with the RTEMS BSP
from what I see of the symbol table and no surprise do not run. :)

From the log I see this which would seem to indicate that I am
not getting any compiler flags passed in.
Executing on host: /home/joel/work-gnat/svn/b-gcc2-powerpc/gcc/xgcc -B/home/joel/work-gnat/svn/b-gcc2-powerpc/gcc/ -O2 -w -fno-show-column -c -o 20001222-1.o /home/joel/work-gnat/svn/gcc/gcc/testsuite/gcc.c-torture/compile/20001222-1.c (timeout = 300)


The generated site.exp doesn't look like my board info is having any

set CFLAGS ""
set HOSTCC "gcc"
set GCC_EXEC_PREFIX "/home/joel/work-gnat/svn/install/lib/gcc/"
set newlib_cflags "-I/home/joel/work-gnat/svn/b-gcc2-powerpc/gcc/../powerpc-rtems4.9/newlib/targ-include -I$srcdir/../newlib/libc/include" set newlib_ldflags "-B/home/joel/work-gnat/svn/b-gcc2-powerpc/gcc/../powerpc-rtems4.9/newlib/"
append CFLAGS " $newlib_cflags"
append CXXFLAGS " $newlib_cflags"

  Haven't tried your testcase yet; I'll look at it if we can't get this going
in just a few rounds of email exchanges.

I think we are getting there.  Just slow due to the imperfect
reception on this end. :)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]