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

synchronization example fails to build for SMP platforms #18124

Closed
abrodkin opened this issue Aug 8, 2019 · 7 comments · Fixed by #18125
Closed

synchronization example fails to build for SMP platforms #18124

abrodkin opened this issue Aug 8, 2019 · 7 comments · Fixed by #18125
Assignees
Labels
area: SMP Symmetric multiprocessing bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@abrodkin
Copy link
Collaborator

abrodkin commented Aug 8, 2019

Initially reported by Shippable here https://app.shippable.com/github/zephyrproject-rtos/zephyr/runs/47829/3/console while reviewing #17992.

Yet could be reproduced for any other SMP platform, for example qemu_x86_64:

# mkdir build
# cd build
# cmake -DBOARD=qemu_x86_64 ../samples/synchronization/

Enable OpenOCD support (CONFIG_OPENOCD_SUPPORT=y).

# make
...
[ 60%] Built target app
In file included from .../include/kernel_includes.h:16,
                 from .../include/kernel.h:17,
                 from .../kernel/include/kernel_structs.h:10,
                 from .../subsys/debug/openocd.c:7:
.../subsys/debug/openocd.c:39:35: error: 'struct z_kernel' has no member named 'current'
  [OPENOCD_OFFSET_K_CURR_THREAD] = offsetof(struct z_kernel, current),
                                   ^~~~~~~~
.../subsys/debug/openocd.c:66:2: warning: #warning Please define OPENOCD_OFFSET_T_STACK_PTR for this architecture [-Wcpp]
 #warning Please define OPENOCD_OFFSET_T_STACK_PTR for this architecture
  ^~~~~~~

@abrodkin abrodkin added bug The issue is a bug, or the PR is fixing a bug area: SMP Symmetric multiprocessing labels Aug 8, 2019
@ioannisg ioannisg added the priority: high High impact/importance bug label Aug 11, 2019
@ioannisg
Copy link
Member

@abrodkin is this issue been taken care off?

@abrodkin
Copy link
Collaborator Author

@ioannisg sorry I was on ETO last 2 weeks with limited access to Internet, now I'm going to re-spin #18125 with fix in for of !SMP dependency of OPENOCD_SUPPORT in subsys/debug/Kconfig. Is that OK?

@ioannisg ioannisg added priority: low Low impact/importance bug and removed priority: high High impact/importance bug labels Aug 20, 2019
@galak
Copy link
Collaborator

galak commented Aug 20, 2019

there are 2 issues here, one is the SMP support, the other is building on X86_64.

So I think #18125 deals with the SMP issue.

@andrewboie does non-SMP on x86_64 make sense?

@abrodkin
Copy link
Collaborator Author

@galak what's the problem with building on X86_64? Maybe I missed some discussion last weeks so pls kindly point me to any relevant information and I'll take a look.

@galak
Copy link
Collaborator

galak commented Aug 20, 2019

@galak what's the problem with building on X86_64? Maybe I missed some discussion last weeks so pls kindly point me to any relevant information and I'll take a look.

The warning #warning Please define OPENOCD_OFFSET_T_STACK_PTR for this architecture is related to x86_64

@abrodkin
Copy link
Collaborator Author

@galak what's the problem with building on X86_64? Maybe I missed some discussion last weeks so pls kindly point me to any relevant information and I'll take a look.

The warning #warning Please define OPENOCD_OFFSET_T_STACK_PTR for this architecture is related to x86_64

Hm... but how can I reproduce it?
I don't see it with:

cmake -DBOARD=qemu_x86_64 ../samples/synchronization/
make

@abrodkin
Copy link
Collaborator Author

@galak what's the problem with building on X86_64? Maybe I missed some discussion last weeks so pls kindly point me to any relevant information and I'll take a look.

The warning #warning Please define OPENOCD_OFFSET_T_STACK_PTR for this architecture is related to x86_64

Hm... but how can I reproduce it?
I don't see it with:

cmake -DBOARD=qemu_x86_64 ../samples/synchronization/
make

Ooops, forgot to enable CONFIG_OPENOCD via menuconfig :(
Now I see it but again this has nothing to do with anything except x86_64 and CONFIG_OPENOCD.

So it looks like we'd need this then (since X86_64 seems to be quite incomplete, judging by contents of https://github.com/zephyrproject-rtos/zephyr/blob/master/arch/x86_64/include/kernel_arch_thread.h):

diff --git a/subsys/debug/Kconfig b/subsys/debug/Kconfig
index a5dff0ad4f..202d7f3f29 100644
--- a/subsys/debug/Kconfig
+++ b/subsys/debug/Kconfig
@@ -223,7 +223,7 @@ config EXCEPTION_STACK_TRACE

 config OPENOCD_SUPPORT
        bool "OpenOCD support [EXPERIMENTAL]"
-       depends on !SMP
+       depends on !SMP && !X86_64
        select THREAD_MONITOR
        select THREAD_NAME
        help

Does that look OK?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: SMP Symmetric multiprocessing bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants