アフィリエイト広告を利用しています

2024年06月05日

システム管理: Emacs HEAD のコンパイル・インストール ── 2024 年 6 月 (1)

6 月 3 日に行った作業の覚え書き.

Emacs HEAD をコンパイルする段階においていくつか問題が発生した.

まとめると

(1) configure スクリプト実行時に libgccjit のテストでエラーになる;
(2) elisp.info 生成時にエラーとなる;
(3) libgccjit 共有ライブラリーが呼び出されたときにエラーとなる;
(4) Emacs の起動時にエラーが出る.



それぞれの問題に対して行ったことをまとめておく.

(1) configure スクリプト実行時に libgccjit のテストでエラーになる;
エラーメッセージは以下の通り:

checking for gcc_jit_context_acquire in -lgccjit... yes
checking for libgccjit.h... yes
configure: error: The installed libgccjit failed to compile and run a test program using
the libgccjit library; see config.log for the details of the failure.
The test program can be found here:
<https://gcc.gnu.org/onlinedocs/jit/intro/tutorial01.html>.
You can try compiling it yourself to investigate the issues.
Please report the issue to your distribution if libgccjit was installed
through that.
You can find the instructions on how to compile and install libgccjit from
source on this site:
<https://gcc.gnu.org/wiki/JIT>.

libgccjit の使用可否テストプログラムのコンパイルと実行に失敗するという内容である.
新しい OpenBSD 7.5 では, これまでの libgccjit が動かない.
libgccjit をコンパイル・インストールし直すことによって解決した.

(2) elisp.info 生成時にエラーとなる.

GEN ../../info/elisp.info
parsetexi/Parsetexi.c: loadable library and perl binaries are mismatched
(got first handshake key 0xec00000, needed 0xeb80000)

現在インストールしてある makeinfo プログラムが, もはや OpenBSD 7.5 では動かないことによる.
makeinfo をソースから作り直す ことにより解決した.

(3) libgccjit 共有ライブラリーが呼び出されたときにエラーとなる.

'../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp \
--eval "(setq load-prefer-newer t byte-compile-warnings 'all)" \
--eval "(setq org--inhibit-version-check t)" \
-l comp -f batch-byte+native-compile emacs-lisp/loaddefs-gen.el
bootstrap-emacs:/usr/local/lib/libgccjit.so.0.0.1: undefined symbol '_Z15fname_as_string'
ld.so: bootstrap-emacs: lazy binding failed!

このエラーメッセージが述べているように, libgccjit 内に _Z15fname_as_string により参照される関数が存在しない.
libgccjit 共有ライブラリーのソースに対するパッチ:

--- libgccjit.c.orig Sun Jun 2 14:00:39 2024
+++ libgccjit.c Sun Jun 2 14:04:37 2024
@@ -3474,3 +3474,9 @@ gcc_jit_context_add_top_level_asm (gcc_jit_context *ct
RETURN_IF_FAIL (asm_stmts, ctxt, NULL, "NULL asm_stmts");
ctxt->add_top_level_asm (loc, asm_stmts);
}
+
+const char *
+fname_as_string(int pretty_P __attribute__((__unused__)))
+{
+ return NULL;
+}

を適用し忘れていたことによるエラーである.
パッチを適用して libgccjit 共有ライブラリーを作り直す ことによって解決した.

(4) Emacs の起動時にエラーが出る.

File is missing: Cannot open load file, No such file or directory, compat-26

原因がなかなかわからなかったが, init.el 内にあった記述:

(require 'compat)

をコメントアウトすることによって解決した.
調べると, emacs_dir/etc/NEWS 内に

** New package Compat.
Emacs now comes with a stub implementation of the
forwards-compatibility Compat package from GNU ELPA. This allows
built-in packages to use the library more effectively, and helps
preventing the installation of Compat if unnecessary.

という記述があった.
GNU ELPA にある compat パッケージに相当する機能が Emacs 本体に組み込まれた, これにより compat パッケージを, それが不要な場合にもわざわざ GNU ELPA からインストールしなくてもよくなった, とのこと.
この原因により, 上記の (require 'compat) が必要なくなったのだと考えられる.

$ git pull
$ gmake
$ gmake check -k
# gmake install

M-x emacs version
This is GNU Emacs 30.0.50 (build 2, x86_64-unknown-openbsd7.5,
X toolkit, cairo version 1.18.0, Xaw3d scroll bars) of 2024-06-03
この記事へのコメント
コメントを書く

お名前:

メールアドレス:


ホームページアドレス:

コメント:

この記事へのトラックバックURL
https://fanblogs.jp/tb/12577997

この記事へのトラックバック
ファン
検索
<< 2024年09月 >>
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30          
最新記事
最新コメント
眼科の定期検査 〜 散歩 by コトタマ (02/15)
眼科の定期検査 by 三文字寄れば文殊のヒフミヨ (09/21)
本を読んで過ごす by 底彦 (12/13)
本を読んで過ごす by ねこ (12/12)
数学の計算をする by 底彦 (12/04)
タグクラウド
カテゴリアーカイブ
仕事(59)
社会復帰(22)
(42)
コンピューター(211)
(1413)
借金(8)
勉強(12)
(12)
数学(97)
運動(8)
日常生活(1384)
(203)
健康(36)
読書(20)
プロフィール

ブログランキング・にほんブログ村へ
にほんブログ村
にほんブログ村 メンタルヘルスブログ うつ病(鬱病)へ
にほんブログ村
にほんブログ村 科学ブログ 数学へ
にほんブログ村
にほんブログ村 IT技術ブログ プログラム・プログラマーへ
にほんブログ村