From a31ee04e75e30f3ca4822b0bc8f58f37f1cc0d45 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Fri, 13 Sep 2024 13:17:26 +0300 Subject: gpsd: apply patch to fix gpsd building on Musl Import the patch from pending MR to fix the way flags are being handled by SConsript. Otherwise CXXFLAGS being added to CCFLAGS, masking test results because of the -fvisibility-inlines-hidden warning turning into error. Signed-off-by: Dmitry Baryshkov Signed-off-by: Khem Raj --- .../gpsd/gpsd/fix-pps_strerror_r.patch | 51 ++++++++++++++++++++++ meta-oe/recipes-navigation/gpsd/gpsd_3.25.bb | 1 + 2 files changed, 52 insertions(+) create mode 100644 meta-oe/recipes-navigation/gpsd/gpsd/fix-pps_strerror_r.patch diff --git a/meta-oe/recipes-navigation/gpsd/gpsd/fix-pps_strerror_r.patch b/meta-oe/recipes-navigation/gpsd/gpsd/fix-pps_strerror_r.patch new file mode 100644 index 0000000000..8942b39524 --- /dev/null +++ b/meta-oe/recipes-navigation/gpsd/gpsd/fix-pps_strerror_r.patch @@ -0,0 +1,51 @@ +From c72a489e2eb13296c7b514b7341033114abf430a Mon Sep 17 00:00:00 2001 +From: Miroslav Lichvar +Date: Mon, 22 Apr 2024 11:31:24 +0200 +Subject: [PATCH 1/2] SConscript: provide variable names to MergeFlags + +If the scons MergeFlags() function is provided with a list of +compiler/linker options, it needs to guess what options belong where. If +it doesn't recognize an option, it is silently ignored. There are also +ambiguous options that could be both in CFLAGS and LINKFLAGS (e.g. -spec). + +Provide MergeFlags() with a dict instead of list to avoid the guesswork +in order to pass all options, even if some are not recognized by scons. +Switch LDFLAGS to LINKFLAGS for better compatibility with existing +scripts. + +Upstream-Status: Submitted [https://gitlab.com/gpsd/gpsd/-/merge_requests/406] +Signed-off-by: Dmitry Baryshkov + +--- + SConscript | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/SConscript b/SConscript +index dab481654..ee90d87c4 100644 +--- a/SConscript ++++ b/SConscript +@@ -585,8 +585,8 @@ env['SC_PYTHON'] = sys.executable # Path to SCons Python + # explicitly quote them or (better yet) use the "=" form of GNU option + # settings. + # +-# Scons also uses different internal names than most other build-systems. +-# So we rely on MergeFlags/ParseFlags to do the right thing for us. ++# Scons also uses different internal names than most other build-systems, ++# e.g. it uses LINKFLAGS instead of LDFLAGS. + # + # scons uses gcc, or clang, to link. Thus LDFLAGS does not serve its + # traditional function of providing arguments to ln. LDFLAGS set in the +@@ -618,7 +618,10 @@ for i in ["ARFLAGS", + "SHLINKFLAGS", + ]: + if i in os.environ: +- env.MergeFlags(Split(os.getenv(i))) ++ t = i ++ if t == "LDFLAGS": ++ t = "LINKFLAGS" ++ env.MergeFlags({t: Split(os.getenv(i))}) + + + # Keep scan-build options in the environment +-- +GitLab diff --git a/meta-oe/recipes-navigation/gpsd/gpsd_3.25.bb b/meta-oe/recipes-navigation/gpsd/gpsd_3.25.bb index 3d817172e2..f893ac359b 100644 --- a/meta-oe/recipes-navigation/gpsd/gpsd_3.25.bb +++ b/meta-oe/recipes-navigation/gpsd/gpsd_3.25.bb @@ -7,6 +7,7 @@ PROVIDES = "virtual/gpsd" SRC_URI = "${SAVANNAH_GNU_MIRROR}/${BPN}/${BP}.tar.gz \ file://gpsd.init \ + file://fix-pps_strerror_r.patch \ " SRC_URI[sha256sum] = "b368b6a305e3f7a6382d23a0cbfc1d78923060b6b7f54cf7987a73c7b4a9afc2" -- cgit v1.2.3-54-g00ecf