美文网首页
systemd与C11标准兼容

systemd与C11标准兼容

作者: 2puT | 来源:发表于2019-03-04 14:14 被阅读0次
systemd与C11标准兼容

从 systemd项目的 github 主线上拉取其源代码,但发现 tag 为 v238、v239 出现编译问题,去要再打兼容性补丁。

拉取 github 上的 systemd 主线分支编译 v238-systemd,编译不通过。

一. 编译v238-systemd两次编译报错

  1. v238-systemd编译报错信息如下
The Meson build system
Version: 0.48.0
Source dir: /home/loongson/SYSTEMD/238
Build dir: /home/loongson/SYSTEMD/238/build
Build type: native build

meson_options.txt:56:0: ERROR:  Option name debug is reserved.
  • 解决方法补丁:v238-meson-rename-Ddebug-to-Ddebug-extra.patch
From 4d9db8c0925c34d02b6a14022c9dd4ddbc2c4dc2 Mon Sep 17 00:00:00 2001
Date: Mon, 25 Feb 2019 13:40:44 +0800
Subject: [PATCH] meson rename Ddebug to Ddebug extra

---
 meson.build       | 2 +-
 meson_options.txt | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index 30b7f1bafa..6cd89d6a86 100644
--- a/meson.build
+++ b/meson.build
@@ -811,7 +811,7 @@ conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
 substs.set('SUSHELL', get_option('debug-shell'))
 substs.set('DEBUGTTY', get_option('debug-tty'))
 
-debug = get_option('debug')
+debug = get_option('debug-extra')
 enable_debug_hashmap = false
 enable_debug_mmap_cache = false
 if debug != ''
diff --git a/meson_options.txt b/meson_options.txt
index 4efb422f90..9025aebff3 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -53,7 +53,7 @@ option('debug-shell', type : 'string', value : '/bin/sh',
        description : 'path to debug shell binary')
 option('debug-tty', type : 'string', value : '/dev/tty9',
        description : 'specify the tty device for debug shell')
-option('debug', type : 'string',
+option('debug-extra', type : 'string',
        description : 'enable extra debugging (hashmap,mmap-cache)')
 option('memory-accounting-default', type : 'boolean',
        description : 'enable MemoryAccounting= by default')
-- 
2.17.2
  1. 由 C11 关键字引发的编译错误
../src/basic/missing.h:528:17: 错误:expected identifier before numeric constant
 #define MS_MOVE 8192                                                             
                 ^~~~                                                                                          
In file included from ../src/basic/architecture.h:25,                                                          
                 from ../src/test/test-tables.c:21:                                                             
../src/basic/macro.h:423:18: 错误:expected ‘)’ before ‘__attribute__’                                          
 #define noreturn __attribute__((noreturn))                                                                     
                  ^~~~~~~~~~~~~                                                                                 
In file included from /usr/include/gcrypt.h:30,                                                                 
                 from ../src/journal/journal-file.h:26,                                                         
                 from ../src/journal/journald-server.h:31,                                                      
                 from ../src/test/test-tables.c:30:                                                             
/usr/include/gpg-error.h:1563:46: 错误:expected ‘,’ or ‘;’ before ‘)’ token                                    
 void gpgrt_log_bug (const char *fmt, ...)    GPGRT_ATTR_NR_PRINTF(1,2);                                        
                                              ^~~~~~~~~~~~~~~~~~~~                                              
In file included from ../src/basic/architecture.h:25,                                                           
                 from ../src/test/test-tables.c:21:

  • 解决方法补丁:basic-macros-rename-noreturn-into-noreturn-8456.patch,因为此补丁上游已有,就不再粘贴复制,此补丁是解决了编译时的 C11 兼容性问题。
  • PATCHID: 848e863acc51ecfb0f3955c498874588201d9130

相关文章

  • systemd与C11标准兼容

    systemd与C11标准兼容 从 systemd项目的 github 主线上拉取其源代码,但发现 tag 为 v...

  • 兼容性和稳定性

    C++11 与 C99 的兼容 C11 之前最新的 C标准是 1999 年制定的 C99 标准。而第一个 C++ ...

  • C语言的原子操作

    C语言原子操作是在C11(C11:标准是C语言标准的第三版,前一个标准版本是[C99]标准)引入的,定义在头文件 ...

  • 在centos7上使用systemd启动supervisor

    介绍 Systemd Systemd 是 Linux 系统工具,用来启动守护进程,已成为大多数发行版的标准配置。可...

  • 腾讯优测标准兼容性测试介绍

    腾讯优测标准兼容性测试介绍 什么是标准兼容性测试 标准兼容性测试,提供具体兼容性特性的云端设备(覆盖主流品牌、SD...

  • 运行程序时的一些废话

    main()函数使用 main() c90标准勉强接受这种形式,但是c99和c11标准不允许这样写,因此,即使你使...

  • C11中的通用字符名(Universal Character N

    C11标准中引入了通用字符名(Universal Character Names)这个概念。其实,所为的通用字符名...

  • c语言标准

    四种标准 k&RC (1978) C89 (1989) C99 (1999) C11 (2011) k&RC 主要...

  • ccf模拟题

    线性分类器: 教训:一定要将测试的printf清理干净 稀疏向量用c11标准,使用 #include usin...

  • 前端面试题汇总

    HTML Doctype作用?标准模式与兼容模式各有什么区别? (1)、<...

网友评论

      本文标题:systemd与C11标准兼容

      本文链接:https://www.haomeiwen.com/subject/jofiuqtx.html