From 730eb8e991ecd62e1c3e3a0c34b7dc5ba4256138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Fri, 15 Nov 2019 00:00:00 +0000 Subject: [PATCH] static g++: clarify pthread problems further --- README.adoc | 9 ++++++--- path_properties.py | 5 ++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.adoc b/README.adoc index 44aca26..c22fdd4 100644 --- a/README.adoc +++ b/README.adoc @@ -3899,7 +3899,10 @@ it fails with: ld: cannot find -lopenblas .... -`g++` and pthreads also causes issues: https://stackoverflow.com/questions/35116327/when-g-static-link-pthread-cause-segmentation-fault-why +`g++` and pthreads also causes issues: + +* https://stackoverflow.com/questions/35116327/when-g-static-link-pthread-cause-segmentation-fault-why +* https://stackoverflow.com/questions/58848694/gcc-whole-archive-recipe-for-static-linking-to-pthread-stopped-working-in-rec As a consequence, the following fails: @@ -3916,13 +3919,13 @@ qemu-x86_64: /path/to/linux-kernel-module-cheat/submodules/qemu/accel/tcg/cpu-ex and if we manually build and run natively on host it segfaults. -If we hack the compilation command to do instead: +The workaround: .... -pthread -Wl,--whole-archive -lpthread -Wl,--no-whole-archive .... -then it works. We should automate that at some point. +fixes some of the problems, but not all, so we are just skipping those tests for now. === gem5 syscall emulation mode diff --git a/path_properties.py b/path_properties.py index a7cd60e..3aa727d 100644 --- a/path_properties.py +++ b/path_properties.py @@ -561,7 +561,10 @@ path_properties_tuples = ( }, { 'abort.c': {'signal_received': signal.Signals.SIGABRT}, - 'atomic.c': {'baremetal': False}, + 'atomic.c': { + 'baremetal': False, + 'test_run_args': {'cpus': 3}, + }, 'assert_fail.c': {'signal_received': signal.Signals.SIGABRT}, # This has complex failure modes, too hard to assert. 'smash_stack.c': {'skip_run_unclassified': True},