zephyriot / zephyr-issues

0 stars 0 forks source link

object files created outside of $O directory when obj-XYZ path is relative #1020

Open nashif opened 8 years ago

nashif commented 8 years ago

Reported by Inaky Perez-Gonzalez:

When an app contains a relative path to a source file, it creates object files outside the $O directory if it is different than "outdir":

$ cd PATH/TO/ZEPHYR
$ rm -rf samples/kernel_event_logger/microkernel/outdir-kk
$ make -C samples/kernel_event_logger/microkernel  \
    ZEPHYR_BASE=$HOME/z/kernel.git \
    BOARD=arduino_101 ARCH=x86 \
    O=outdir-kk 
...
  CC      src/../../../philosophers/microkernel/src/phil_fiber.o
...
$ find -iname \*.o | grep -v outdir-kk | grep o$ 
./samples/kernel_event_logger/philosophers/microkernel/src/phil_fiber.o

phil_fiber.o should be created under samples/kernel_event_logger/microkernel/outdir-kk/samples/kernel_event_logger/outdir-kk/philosophers/microkernel/src/.

This affects many other testcases (listed below) and makes it impossible to reliably build all of them in a single tree in different outdirs, like the test automation does without entering into random build failures.

Affected samples & test cases:

samples/kernel_event_logger/microkernel/ samples/task_profiler/sample_nanokernel_app/ samples/task_profiler/sample_microkernel_app/ samples/net/coap_observe_client/ samples/net/trickle-legacy/ samples/net/echo_server/ samples/net/dtls_server/ samples/net/paho_mqtt_clients/subscriber/ samples/net/echo_client/ samples/net/zperf/ samples/net/nats_clients/subscriber/ samples/net/coap_server/ samples/bluetooth/peripheral_hids/ samples/bluetooth/peripheral_esp/ samples/bluetooth/peripheral_csc/ samples/bluetooth/peripheral_sc_only/ samples/bluetooth/peripheral/ samples/bluetooth/peripheral_dis/ samples/bluetooth/ipsp/ samples/bluetooth/peripheral_hr/ drivers/bluetooth/nble/Makefile tests/crypto/test_ecc_dh/

(Imported from Jira ZEP-1123)

nashif commented 8 years ago

by Inaky Perez-Gonzalez:

Anas Nashif suggested Kumar might be the best person to deal with this guy.

nashif commented 8 years ago

by Mark Linkmeyer:

Per review with Anas in the Zephyr SXT meeting on 11/10, this should be a Medium priority bug and not Highest priority. Therefore I'm changing it.

nashif commented 7 years ago

by Mark Linkmeyer:

Fixing incorrect priority