[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[plamo:27102] Re: Plamo4.2でmysql-5.0.20がコンパイルできない?



こんにちは。 とよ@といずねっとです。

こじまさん・佐賀井さん ありがとうございます。

どちらの方法でも、コンパイルが通りました。

kernel2.6ベースのSlackware10.2でもうまくコンパイルできていたの
ですが、/usr/include/asmはkernel2.4のヘッダーがおいてありました。

今回はMySQL側へのパッチで対応したけど、根本的には/usr/include/asmの
ファイルの修正がよいのでしょうか?



KOJIMA Mitsuhiro wrote:
> 佐賀井さんからも紹介いただいていますが,mysql 側の修正で済ませるなら,
> my_global.h の中でread/write_cr4 を定義してしまえばコンパイルは通りそう.
> kojima@xeon[/mnt/Srcs/mysql-5.0.20]% diff -c  include/my_global.h~ include/my_global.h
> *** include/my_global.h~	2006-04-01 02:10:26.000000000 +0900
> --- include/my_global.h	2006-04-19 14:31:48.000000000 +0900
> ***************
> *** 315,320 ****
> --- 315,330 ----
>   #define new my_arg_new
>   #define need_to_restore_new 1
>   C_MODE_START
> + #define read_cr4() ({ \
> + 	unsigned int __dummy; \
> + 	__asm__( \
> + 		"movl %%cr4,%0\n\t" \
> + 		:"=r" (__dummy)); \
> + 	__dummy; \
> + })
> + #define write_cr4(x) \
> + 	__asm__ __volatile__("movl %0,%%cr4": :"r" (x));
> + 
>   #include <asm/atomic.h>
>   C_MODE_END
>   #ifdef need_to_restore_new /* probably safer than #ifdef new */
> 
> これはあくまで急場しのぎの解決で,i386 なアーキテクチャに依存しちゃうか
> ら,asm/processor.h を修正してしまうのが正解かも知れない.
> From: KOJIMA Mitsuhiro <kojima@linet.gr.jp>
> Subject: [plamo:27098] Re: Plamo4.2でmysql-5.0.20がコンパイルできない?
> Date: Wed, 19 Apr 2006 11:40:16 +0900 (JST)
>> read_cr4 は /usr/include/asm/system.h で定義されているのだけど,#ifdef
>> __KERNEL__ でくくられていますね.本来,このヘンのインクルードファイルは
>> アプリから直接操作すべきではないのだけど,高速化のためにかなり奥の方の
>> 機能まで使っているのかな? > MySQL
>> 多分,configure する前に setenv CXXFLAGS -D__KERNEL__ みたいな環境変数
>> を指定してやればこのエラーは回避できそうだけど,今度は TIMEZONE 回りで
>> エラーが出てますね.
> これをやっちゃうと,min とか max の定義もカーネルコンパイル時専用の
> 定義に書きかえられてしまうため
>> g++ -DMYSQL_SERVER -DDEFAULT_MYSQL_HOME="\"/usr/local\"" -DDATADIR="\"/usr/local/var\"" -DSHAREDIR="\"/usr/local/share/mysql\"" -DHAVE_CONFIG_H -I. -I. -I.. -I../innobase/include -I../include -I../include -I../regex -I.      -DDBUG_OFF -D__KERNEL__   -fno-implicit-templates -fno-exceptions -fno-rtti -c -I../innobase/include -I../include -I../include -I../regex -I.   -DTZINFO2SQL mysql_tzinfo_to_sql.cc
>> mysql_tzinfo_to_sql.cc: In function `my_bool tz_load(const char*, TIME_ZONE_INFO*, MEM_ROOT*)':
>> mysql_tzinfo_to_sql.cc:171: error: statement-expressions are allowed only inside functions
>> mysql_tzinfo_to_sql.cc:171: error: `_x' undeclared (first use this function)
>> mysql_tzinfo_to_sql.cc:171: error: (未宣言変数については、それが関数内で最初に現われた時だけ報告されます。)
>> mysql_tzinfo_to_sql.cc:171: error: `_y' undeclared (first use this function)
>> mysql_tzinfo_to_sql.cc:179: error: 'union tz_load(const char*, TIME_ZONE_INFO*, MEM_ROOT*)::<anonymous>' has no member named 'buf'
>> mysql_tzinfo_to_sql.cc:179: error: 'union tz_load(const char*, TIME_ZONE_INFO*, MEM_ROOT*)::<anonymous>' has no member named 'buf'
> こういうエラーになるみたいです.
> -------
> こじま

Follow-Ups
[plamo:27104] Re: Plamo4.2でmysql-5.0.20がコンパイルできない?, KOJIMA Mitsuhiro
References
[plamo:27096] Plamo4.2でmysql-5.0.20がコンパイルできない?, Toyoaki Hatsukano
[plamo:27098] Re: Plamo4.2でmysql-5.0.20がコンパイルできない?, KOJIMA Mitsuhiro
[plamo:27100] Re: Plamo4.2でmysql-5.0.20がコンパイルできない?, KOJIMA Mitsuhiro

[検索ページ] [メール一覧]
Plamo ML 公開システム