SystemdはC 11規格と互換性がある


SystemdはC 11規格と互換性がある
システムdプロジェクトのgithubメインラインからソースコードを引きますが、tagがv 238、v 239のコンパイルに問題があることがわかり、互換性パッチを適用します.
github上のsystemd主線分岐コンパイルv 238-systemdを引き、コンパイルは通過しない.
一.コンパイルv 238-systemd 2回コンパイルエラー
  • v 238-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.
    
  • 解決方法パッチ:v 238-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
    
  • C 11キーワードによるコンパイルエラー
  • ../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.パッチは、このパッチの上流に既に存在するため、コピーは貼り付けられません.このパッチは、コンパイル時のC 11互換性の問題を解決します.
  • PATCHID: 848e863acc51ecfb0f3955c498874588201d9130

  • 簡単な文書の住所:https://www.jianshu.com/p/bfb941d68972githubプロジェクトのホームページ:https://github.com/lina-not-linus