brushtechnology / fabricate

The better build tool. Finds dependencies automatically for any language.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

openat syscall missing from strace runner, breaks dependency tracking for relatively recent gcc.

stevenj opened this issue · comments

I am using fabricate for an embedded system build using the ARM GCC compiler:
/gcc-arm-none-eabi-7-2017-q4-major

I am not getting any header files in the dependency list using the strace runner. The reason is because gcc is (now?) using the syscall openat and fabricate doesn't know about it.

for example, running strace directly on a file that isn't getting it's includes found as dependencies and grepping on one of the known headers gives:

strace -f /opt/arm/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc -Wall -mcpu=cortex-m0plus -mtune=cortex-m0plus -mthumb -fstrict-volatile-bitfields -ffunction-sections -fdata-sections -O3 -std=gnu11 -D__SAMD21J18A__ -Wa,-ahls=build/optimized/speed/ARM/SAMD21J18A/OvenACE/piezo_buzzer.lst -I OvenACE -I OvenACE/usb -I OvenACE/usb/class/vendor -I OvenACE/usb/class/cdc -I OvenACE/usb/class/cdc/device -I OvenACE/usb/class/hub -I OvenACE/usb/class/msc -I OvenACE/usb/class/msc/device -I OvenACE/usb/class/composite/device -I OvenACE/usb/device -I OvenACE/samd21a/include -I OvenACE/samd21a/include/component -I OvenACE/samd21a/include/pio -I OvenACE/samd21a/include/instance -I OvenACE/config -I OvenACE/thirdparty/RTOS -I OvenACE/thirdparty/RTOS/freertos/FreeRTOSV10.0.0 -I OvenACE/thirdparty/RTOS/freertos/FreeRTOSV10.0.0/Source/include -I OvenACE/thirdparty/RTOS/freertos/FreeRTOSV10.0.0/Source/portable/GCC/ARM_CM0 -I OvenACE/hri -I OvenACE/hal/utils/include -I OvenACE/hal/include -I OvenACE/hpl/core -I OvenACE/hpl/pm -I OvenACE/hpl/port -I OvenACE/hpl/gclk -I OvenACE/CMSIS/Include -I OvenACE/examples -I OvenACE/ijg/example -I OvenACE/ijg/jpeg-9b -I OvenACE/dma_m2m -c OvenACE/piezo_buzzer.c -o build/optimized/speed/ARM/SAMD21J18A/OvenACE/piezo_buzzer.o 2>&1 | grep 'HWPinAssignments\.h'
[pid 24407] openat(AT_FDCWD, "OvenACE/HWPinAssignments.h", O_RDONLY|O_NOCTTY) = 4

This is a patch, based on my fork which has deviated from this version, so i can't do a clean pull request. It works in my fork, i include this here in case someone wants to apply it.
fabricate.py.patch.txt

I created a PR before I noticed @stevenj's issue. The PR for the openat fix is here

The fix has been merged! Thanks for opening the issue!