Commit Graph

18 Commits

Author SHA1 Message Date
Marc Herbert 38a730b9c9 rebuild-testbench.sh: add incremental build command in help message
Add interactive menuconfig and incremental build commands in help
message of rebuild-testbench.sh

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-12-19 16:54:45 +00:00
Marc Herbert 27e5f40b9a rebuild-testbench.sh: error when unknown arguments are passed
Silently discarding user input is really bad.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-12-19 16:54:45 +00:00
Marc Herbert acc4f672db rebuild-testbench.sh: use cmake -B to simplify rebuild_testbench()
Cosmetic change.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-12-19 16:54:45 +00:00
Marc Herbert caf28abbcd rebuild-testbench.sh: rename BUILD_TESTBENCH_DIR to TESTBENCH_DIR
It's a source directory, not a build directory.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-12-19 16:54:45 +00:00
Marc Herbert 954b862017 rebuild-testbench.sh: move all constants at the top
Cosmetic change.

Also exit 0 when using -h; it's not a crime!

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-12-19 16:54:45 +00:00
Marc Herbert 3e09f233a4 set_xtensa_params.sh: add ZEPHYR_TOOLCHAIN_VARIANT
This helps with Zephyr and does not hurt anyone else.

Adjust rebuild-testbench.sh accordingly.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-12-13 22:17:35 +02:00
Marc Herbert 7b8068963c scripts: rename XTENSA_TOOLS_VERSION to TOOLCHAIN_VER as in Zephyr
Rename the variable name used by SOF script with the one expected by the
Zephyr build system for simplicity and consistency.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-12-13 22:17:35 +02:00
Seppo Ingalsuo 2006297ee2 Scripts: Testbench: Add xt-testbench build for MTL with xt-clang
Build for MTL needs other compiler xt-clang, so the COMPILER is
set by default to xt-xcc and changed for MTL in set_xtensa_params.sh
where also core and tools version is defined.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-11-08 16:39:29 +00:00
Marc Herbert 59a5bc7448 rebuild-testbench.sh: explain BUILD_TYPE=native in usage()
Explain what happens when running the script without any argument.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-10-25 16:09:17 +03:00
Marc Herbert bcdf037d2c rebuild-testbench.sh: drop no-op LDFLAGS=-Wl,-LE
It's not clear why `LDFLAGS=-Wl,-LE` was added in
commit 10d0b3b5e1 ("Scripts: Add xt-run build target for
rebuild-testbench.sh"). Maybe it was supposed to be `-Wl,-EL`?

Either way this flag has always been interpreted as adding the directory
`./E/` to the search library path, which obviously never had any
effect; proof below. So it can safely be removed.

Here's the proof:

```
mv ~/XCC/install/builds/RG-2017.8-linux/cavs2x_LX6HiFi3_2017_8/xtensa-elf/lib/libm.a .

./scripts/rebuild-testbench.sh -p tgl

  # Fails as expected
  # => XCC/install/tools/RG-2017.8-linux/XtensaTools/bin/xt-ld: cannot find -lm

cmake --build tools/testbench/build_xt_testbench/ -- testbench

  # Same again
  # => XCC/install/tools/RG-2017.8-linux/XtensaTools/bin/xt-ld: cannot find -lm

mkdir tools/testbench/build_xt_testbench/E/
cp libm.a  tools/testbench/build_xt_testbench/E/
cmake --build tools/testbench/build_xt_testbench/ -- testbench

  # => now compiles!
```

Remember: the best way to test software is always to break it.

Don't forget to fix XCC:

```
mv libm.a ~/XCC/install/builds/RG-2017.8-linux/cavs2x_LX6HiFi3_2017_8/xtensa-elf/lib/
```

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-10-25 16:09:17 +03:00
Marc Herbert c1ae62e32b rebuild-testbench.sh: add -j jobs option
This is required to investigate build failures. Because of the way the
build is split, a failure in one component can become totally drown in
the long build logs of another component.

Example: with -j2 the `parser_ep` build failure below is completely
drown by the long (and successful!) build logs of `sof_ep`:

```
./scripts/rebuild-testbench.sh -j 1 -p tgl

sof/tools/testbench/build_xt_testbench/sof_parser/build/include/alsa/
sound/asoc.h:196: error: expected specifier-qualifier-list before ‘__le32’
```

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-05-17 12:58:39 +03:00
Marc Herbert 565a252c1d rebuild-testbench.sh: add missing shellcheck source=
Fixes last shellcheck -x warning

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-05-17 12:58:39 +03:00
Marc Herbert f0d1d4918f rebuild-testbench.sh: testbench_usage(): add missing ;;
Also: don't fail silently.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-05-17 12:58:39 +03:00
Seppo Ingalsuo 10d0b3b5e1 Scripts: Add xt-run build target for rebuild-testbench.sh
This patch adds to rebuild-testbench option -x <platform> that
can be used to build testbench for xt-run execution. The enhanced
script reuses native testbench build but with CC, LD, LDFLAGS,
etc. defines to use the xt-xcc compiler for build.

Currently TGL (HiFi3) is the only supported platform. More will
be added later.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-05-04 18:07:52 +03:00
Marc Herbert e17b90d9b2 scripts: replace "make" with "cmake --build"
This makes it possible to switch to Ninja with a single line change
which can be useful to test build changes and issues.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-01-18 16:11:46 +00:00
Marc Herbert 2aa62e1e65 rebuild-testbench.sh: don't build twice with combined "make install"
"make + make install" duplicates many steps, probably because of the
fatal combination of build timestamps + source hash, see PR #3353 for a
similar example.

A single, combined "make install" generates the exact same binary
outputs 30% faster and prints 30% shorter build logs.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-11-03 16:48:02 +00:00
Marc Herbert 6be9315596 rebuild-testbench.sh: remove CMAKE_VERBOSE_MAKEFILE
Default is verbose enough. VERBOSE=1 can still be used later at make
time.

Also change nproc to nproc --all because we don't care about offline
processors.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-01 16:26:15 +01:00
Mohana Datta Yelugoti 46578cb103 scripts: Add a new script to rebuild testbench
Currently, the testbench is built using the script named
'host-build-all.sh' under scripts directory. But the name of
the script, it's git history doesn't refer to what the script
is currently doing now.

The newly written script adds option to build the testbench.
This script was written in mind to remove the old script
used to build the testbench (i.e host-build-all.sh).

The script also adds an option to build the testbench with
AFL instrumentation. AFL fuzzer works well when the code
it's trying to fuzz is instrumented properly. The instrumentation
helps the fuzzer in generating unique inputs which cover
different paths in the code graph. When the option is set,
testbench is built using a compiler AFL provides, which does
the instrumentation work.

Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
2020-08-28 13:38:04 +01:00