Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin zephyr to a particular commit in west.xml #64

Merged
merged 1 commit into from
May 13, 2021

Conversation

anujdeshpande
Copy link
Contributor

Hey @cfriedt - I had to make changes to the patch to be able to apply it. Does this look better? I checked if it applies correctly, but still figuring out the rest of the setup - so can't verify.

@anujdeshpande
Copy link
Contributor Author

anujdeshpande commented Mar 3, 2021

Before fixing the patch, I got the following error on my git apply

base) ➜ zephyr (7162786f83) ✗ git apply --verbose ../greybus/zephyr-dynamic-pthread-stacks.patch
Checking patch include/kernel.h...
error: while searching for:
 */
#define K_INHERIT_PERMS (BIT(3))

#ifdef CONFIG_X86
/* x86 Bitmask definitions for threads user options */


error: patch failed: include/kernel.h:488
error: include/kernel.h: patch does not apply
Checking patch include/posix/pthread.h...
Checking patch lib/posix/Kconfig...
Checking patch lib/posix/pthread.c...
Checking patch tests/posix/common/prj.conf...
Checking patch tests/posix/common/src/main.c...
Checking patch tests/posix/common/src/pthread.c...
Checking patch tests/posix/common/testcase.yaml...
Hunk #1 succeeded at 37 (offset 1 line).

After the above fix, I got an error during build

(base) ➜ zephyr (7162786f83) ✗ west build -b $BOARD  ../greybus/samples/subsys/greybus/net

-- west build: generating a build system
-- Application: /home/anuj/zephyrproject/greybus/samples/subsys/greybus/net
-- Zephyr version: 2.5.99 (/home/anuj/zephyrproject/zephyr)
-- Found Python3: /home/anuj/miniconda3/bin/python3.7 (found suitable exact version "3.7.6") found components: Interpreter
-- Found west (found suitable version "0.9.0", minimum required is "0.7.1")
-- Board: cc1352r_sensortag
-- Cache files will be written to: /home/anuj/.cache/zephyr
-- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
-- Using toolchain: zephyr 0.12.3 (/home/anuj/zephyr-sdk-0.12.3)
-- Found dtc: /home/anuj/zephyr-sdk-0.12.3/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
-- Found BOARD.dts: /home/anuj/zephyrproject/zephyr/boards/arm/cc1352r_sensortag/cc1352r_sensortag.dts
-- Found devicetree overlay: /home/anuj/zephyrproject/greybus/samples/subsys/greybus/net/boards/cc1352r_sensortag.overlay
-- Generated zephyr.dts: /home/anuj/zephyrproject/zephyr/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /home/anuj/zephyrproject/zephyr/build/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: /home/anuj/zephyrproject/zephyr/build/zephyr/include/generated/device_extern.h
Parsing /home/anuj/zephyrproject/zephyr/Kconfig
Loaded configuration '/home/anuj/zephyrproject/zephyr/boards/arm/cc1352r_sensortag/cc1352r_sensortag_defconfig'
Merged configuration '/home/anuj/zephyrproject/greybus/samples/subsys/greybus/net/prj.conf'
Merged configuration '/home/anuj/zephyrproject/greybus/samples/subsys/greybus/net/boards/cc1352r_sensortag.conf'
Configuration saved to '/home/anuj/zephyrproject/zephyr/build/zephyr/.config'
Kconfig header saved to '/home/anuj/zephyrproject/zephyr/build/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/anuj/zephyr-sdk-0.12.3/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
-- Configuring done
-- Generating done
-- Build files have been written to: /home/anuj/zephyrproject/zephyr/build
-- west build: building application
[1/234] Preparing syscall dependency handling

[101/234] Building C object zephyr/lib/posix/CMakeFiles/lib__posix.dir/pthread.c.obj
FAILED: zephyr/lib/posix/CMakeFiles/lib__posix.dir/pthread.c.obj
ccache /home/anuj/zephyr-sdk-0.12.3/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DBUILD_VERSION=zephyr-v2.5.0-656-g7162786f83f9 -DKERNEL -D_FORTIFY_SOURCE=2 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -I../kernel/include -I../arch/arm/include -I../include -Izephyr/include/generated -I../soc/arm/ti_simplelink/cc13x2_cc26x2 -I../lib/libc/newlib/include -I../lib/util/fnmatch/. -I../subsys/net/lib/sockets/. -I../subsys/net/lib/conn_mgr/. -I../subsys/net/lib/dns/. -I/home/anuj/zephyrproject/greybus/include -I/home/anuj/zephyrproject/greybus/subsys/greybus/../../../include -I/home/anuj/zephyrproject/modules/hal/cmsis/CMSIS/Core/Include -I/home/anuj/zephyrproject/modules/hal/ti/simplelink/source/ti/devices/cc13x2_cc26x2/. -I/home/anuj/zephyrproject/modules/hal/ti/simplelink/. -I/home/anuj/zephyrproject/modules/hal/ti/simplelink/source -I/home/anuj/zephyrproject/greybus/samples/subsys/greybus/net/../../../../../include -Os -imacros /home/anuj/zephyrproject/zephyr/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -imacros /home/anuj/zephyrproject/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-address-of-packed-member -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=/home/anuj/zephyrproject/greybus/samples/subsys/greybus/net=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/anuj/zephyrproject/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/anuj/zephyrproject=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=nano.specs -std=c99 -MD -MT zephyr/lib/posix/CMakeFiles/lib__posix.dir/pthread.c.obj -MF zephyr/lib/posix/CMakeFiles/lib__posix.dir/pthread.c.obj.d -o zephyr/lib/posix/CMakeFiles/lib__posix.dir/pthread.c.obj   -c /home/anuj/zephyrproject/zephyr/lib/posix/pthread.c
/home/anuj/zephyrproject/zephyr/lib/posix/pthread.c: In function 'pthread_exit':
/home/anuj/zephyrproject/zephyr/lib/posix/pthread.c:447:15: error: 'struct k_thread' has no member named 'fn_abort'
  447 |   self->thread.fn_abort = zephyr_pthread_stack_reclaim;
      |               ^
[110/234] Building C object zephyr/subsys/net/ip/CMakeFiles/subsys__net__ip.dir/net_if.c.obj
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /usr/bin/cmake --build /home/anuj/zephyrproject/zephyr/build

Figuring out what I missed now. Definitely related to the pthread patch by the looks of it, so have marked this PR as WIP

@cfriedt
Copy link
Owner

cfriedt commented Mar 3, 2021

@anujdeshpande - it looks like fn_abort was removed in Zephyr commit zephyrproject-rtos/zephyr@c0c8cb0 .

Likely your build / PR will work if you change master to zephyrproject-rtos/zephyr@fc1b5de in west.yml.

This unfortunately pins greybus-for-zephyr to a specific Zephyr commit. A fix for issue #10 should eliminate the issue entirely.

@anujdeshpande
Copy link
Contributor Author

@cfriedt thanks for the pointer to the commit. Pinning that in west.yml got me to building it the uart sample correctly for cc1352 sensor tag. I've updated my commit for this PR to remove the patch change, and change the west.yml instead.

@anujdeshpande anujdeshpande changed the title WIP : Fix pthread patch line numbers Fix pthread patch line numbers Mar 4, 2021
@anujdeshpande anujdeshpande changed the title Fix pthread patch line numbers Pin zephyr to a particular commit in west.xml Mar 4, 2021
@cfriedt cfriedt merged commit 618b4fa into cfriedt:master May 13, 2021
@cfriedt
Copy link
Owner

cfriedt commented May 13, 2021

Thanks for your PR @anujdeshpande !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants