Hi,
I am trying to recreate the reference platform scores as reported here: https://github.com/embench/embench-iot/tree/master/doc#reference-platform
I fetched the AArch32 bare-metal target GCC 9.2 found here.
This comes with binutils 2.33.1 (same as reference platform), and newlib nano 3.1.0 (not the same as reference platform).
To get the newlib 3.3.0, I cloned the newlib repo and checked out the commit with the tag 'newlib-3.3.0'. I then configured and built using these options (that from my understanding, build 'newlib-nano'):
./configure --target=arm-none-eabi --enable-newlib-reent-small --disable-newlib-fvwrite-in-streamio --disable-newlib-fseek-optimization --disable-newlib-wide-orient --enable-newlib-nano-malloc --disable-newlib-unbuf-stream-opt --enable-lite-exit --enable-newlib-global-atexit --enable-newlib-nano-formatted-io --disable-nls
Is this the correct way to build newlib-nano? The README was not explicit as to what options were used to build newlib nano.
My embench-iot/config/arm/chips/cortex-m4/chip.cfg looks like this:
cc = 'arm-none-eabi-gcc'
cflags = [
'-c', '-Os', '-march=armv7-m', '-mcpu=cortex-m4', '-ffunction-sections', '-mfloat-abi=soft', '-mthumb'
]
ldflags = [
'-T/path/to/embench-iot/config/arm/boards/stm32f4-discovery/STM32F407XG.ld',
'-O2', '-Wl,-gc-sections', '-march=armv7-m', '-mcpu=cortex-m4', '-mfloat-abi=soft', '-mthumb', '-specs=nosys.specs'
]
and my build_all.py line like this:
./build_all.py --builddir build_arm_gcc_size --arch arm --chip cortex-m4 --board stm32f4-discovery
However, when running the benchmark_size.py
, I get scores that are much larger than 1.00 (upwards of 20!). What am I doing wrong here? Everything seems to fall in line in what's outlined in the README, yet I'm getting such different results.
Edit:
Upon further research, it seems that the benchmarks are including lots of the c library. When comparing benchmarks using another toolchain (in this case, riscv32), those functions are not included. For example, memcpy and strlen are included in the arm elf but are not used anywhere. I think this accounts for the size differences, so the main question is why is this happening?
Thank you,
Joe