public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Yixun Lan" <dlan@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: app-i18n/fcitx/, app-i18n/fcitx/files/
Date: Sat, 06 Sep 2025 07:41:52 +0000 (UTC)	[thread overview]
Message-ID: <1757144459.a8a6109b89bb0d28e90a72ed52e8381950def8c6.dlan@gentoo> (raw)

commit:     a8a6109b89bb0d28e90a72ed52e8381950def8c6
Author:     Yongxiang Liang <tanekliang <AT> gmail <DOT> com>
AuthorDate: Sat Sep  6 00:46:42 2025 +0000
Commit:     Yixun Lan <dlan <AT> gentoo <DOT> org>
CommitDate: Sat Sep  6 07:40:59 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a8a6109b

app-i18n/fcitx: fix build with -Werror=odr

Fixes already accepted in upstream repo

Closes: https://bugs.gentoo.org/959484
Closes: https://github.com/gentoo/gentoo/pull/43681
Signed-off-by: Yongxiang Liang <tanekliang <AT> gmail.com>
Signed-off-by: Yixun Lan <dlan <AT> gentoo.org>

 app-i18n/fcitx/fcitx-5.1.14.ebuild                 |   2 +
 .../files/fcitx-5.1.14-fix-crashlog-odr.patch      | 170 +++++++++++++++++++++
 2 files changed, 172 insertions(+)

diff --git a/app-i18n/fcitx/fcitx-5.1.14.ebuild b/app-i18n/fcitx/fcitx-5.1.14.ebuild
index 984d53304502..14bfde71a8ec 100644
--- a/app-i18n/fcitx/fcitx-5.1.14.ebuild
+++ b/app-i18n/fcitx/fcitx-5.1.14.ebuild
@@ -74,6 +74,8 @@ BDEPEND="
 	kde-frameworks/extra-cmake-modules:0
 "
 
+PATCHES=( "${FILESDIR}"/${P}-fix-crashlog-odr.patch )
+
 src_configure() {
 	local mycmakeargs=(
 		-DENABLE_DBUS=on

diff --git a/app-i18n/fcitx/files/fcitx-5.1.14-fix-crashlog-odr.patch b/app-i18n/fcitx/files/fcitx-5.1.14-fix-crashlog-odr.patch
new file mode 100644
index 000000000000..cde3a1e1e4b0
--- /dev/null
+++ b/app-i18n/fcitx/files/fcitx-5.1.14-fix-crashlog-odr.patch
@@ -0,0 +1,170 @@
+https://github.com/fcitx/fcitx5/commit/5b12bf216dda31c0f11eb85af54a43fce9d5a2ab
+
+Fix crashlog being inconsistent type in main/errorhandler.
+
+--- a/src/server/errorhandler.cpp
++++ b/src/server/errorhandler.cpp
+@@ -14,7 +14,7 @@
+ #include <cstdint>
+ #include <cstring>
+ #include <ctime>
+-#include <string>
++#include <filesystem>
+ #include "fcitx-utils/fs.h"
+ #include "fcitx-utils/standardpaths.h"
+ #include "fcitx-utils/unixfd.h"
+@@ -31,15 +31,30 @@
+ #define MINIMAL_BUFFER_SIZE 256
+ #define BACKTRACE_SIZE 32
+
+-extern int selfpipe[2];
+-extern std::string crashlog;
++namespace fcitx {
++
++static int signalPipe;
++static std::filesystem::path crashlog;
+
+ struct MinimalBuffer {
+     char buffer[MINIMAL_BUFFER_SIZE];
+     int offset;
+ };
+
+-void SetMyExceptionHandler() {
++static void OnException(int signo);
++
++void SetMyExceptionHandler(int pipeFd) {
++
++    auto userDir =
++        StandardPaths::global().userDirectory(StandardPathsType::PkgConfig);
++    if (!userDir.empty()) {
++        if (fs::makePath(userDir)) {
++            crashlog = userDir / "crash.log";
++        }
++    }
++
++    signalPipe = pipeFd;
++
+     int signo;
+
+     for (signo = SIGHUP; signo < SIGUNUSED; signo++) {
+@@ -115,7 +130,7 @@ static inline void _write_buffer(int fd, const MinimalBuffer *buffer) {
+ void OnException(int signo) {
+     if (signo == SIGCHLD) {
+         uint8_t sig = (signo & 0xff);
+-        fcitx::fs::safeWrite(selfpipe[1], &sig, 1);
++        fcitx::fs::safeWrite(signalPipe, &sig, 1);
+         signal(signo, OnException);
+         return;
+     }
+@@ -180,10 +195,12 @@ void OnException(int signo) {
+         if (signo < 0xff) {
+             sig = (uint8_t)(signo & 0xff);
+         }
+-        fcitx::fs::safeWrite(selfpipe[1], &sig, 1);
++        fcitx::fs::safeWrite(signalPipe, &sig, 1);
+         signal(signo, OnException);
+     } break;
+     }
+ }
+
++} // namespace fcitx
++
+ // kate: indent-mode cstyle; space-indent on; indent-width 0;
+--- a/src/server/errorhandler.h
++++ b/src/server/errorhandler.h
+@@ -16,23 +16,15 @@
+ #ifndef SIGUNUSED
+ #define SIGUNUSED 29
+ #endif
+-/* ***********************************************************
+-// Data structures
+-// *********************************************************** */
+
+-/* ***********************************************************
+-// Functions
+-// *********************************************************** */
++namespace fcitx {
+
+ //
+ // Set Posix Signal Handler
+ //
+ //
+-void SetMyExceptionHandler(void);
++void SetMyExceptionHandler(int pipeFd);
+
+-//
+-// Process Posix signal
+-//
+-void OnException(int signo);
++} // namespace fcitx
+
+ #endif
+--- a/src/server/main.cpp
++++ b/src/server/main.cpp
+@@ -8,21 +8,17 @@
+ #include <sys/stat.h>
+ #include <clocale>
+ #include <cstdio>
+-#include <cstdlib>
+ #include <exception>
+ #include <filesystem>
+ #include <iostream>
+ #include <string>
+-#include <utility>
+ #include <vector>
+ #include "fcitx-utils/environ.h"
+-#include "fcitx-utils/fs.h"
+ #include "fcitx-utils/log.h"
+ #include "fcitx-utils/misc.h"
+ #include "fcitx-utils/misc_p.h"
+ #include "fcitx-utils/standardpath.h"
+ #include "fcitx-utils/standardpaths.h"
+-#include "fcitx-utils/stringutils.h"
+ #include "fcitx/addonfactory.h"
+ #include "fcitx/addoninstance.h"
+ #include "fcitx/addonloader.h"
+@@ -31,8 +27,6 @@
+ #include "errorhandler.h"
+
+ using namespace fcitx;
+-int selfpipe[2];
+-std::filesystem::path crashlog;
+
+ FCITX_DEFINE_STATIC_ADDON_REGISTRY(getStaticAddon)
+ #ifdef ENABLE_KEYBOARD
+@@ -43,7 +37,8 @@ int main(int argc, char *argv[]) {
+     umask(077);
+     StandardPath::global().syncUmask();
+     StandardPaths::global().syncUmask();
+-    if (safePipe(selfpipe) < 0) {
++    int selfPipe[2];
++    if (safePipe(selfPipe) < 0) {
+         fprintf(stderr, "Could not create self-pipe.\n");
+         return 1;
+     }
+@@ -54,15 +49,7 @@ int main(int argc, char *argv[]) {
+         return 1;
+     }
+
+-    auto userDir =
+-        StandardPaths::global().userDirectory(StandardPathsType::PkgConfig);
+-    if (!userDir.empty()) {
+-        if (fs::makePath(userDir)) {
+-            crashlog = userDir / "crash.log";
+-        }
+-    }
+-
+-    SetMyExceptionHandler();
++    SetMyExceptionHandler(selfPipe[1]);
+
+     setlocale(LC_ALL, "");
+
+@@ -74,7 +61,7 @@ int main(int argc, char *argv[]) {
+         FCITX_LOG_IF(Info, isInFlatpak()) << "Running inside flatpak.";
+         Instance instance(argc, argv);
+         instance.setBinaryMode();
+-        instance.setSignalPipe(selfpipe[0]);
++        instance.setSignalPipe(selfPipe[0]);
+         instance.addonManager().registerDefaultLoader(&getStaticAddon());
+
+         ret = instance.exec();


             reply	other threads:[~2025-09-06  7:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-06  7:41 Yixun Lan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-10-04 15:18 [gentoo-commits] repo/gentoo:master commit in: app-i18n/fcitx/, app-i18n/fcitx/files/ Andreas Sturmlechner
2024-08-15 20:35 Sam James
2020-11-11 20:21 Mike Gilbert
2017-09-21 21:06 Mike Gilbert
2016-04-28 21:07 Mike Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1757144459.a8a6109b89bb0d28e90a72ed52e8381950def8c6.dlan@gentoo \
    --to=dlan@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox