miwarin / netbsd-gnats-memo

0 stars 0 forks source link

bin/45994 ld(1) warnings when building profiling binaries #32

Open miwarin opened 9 years ago

miwarin commented 9 years ago

http://gnats.netbsd.org/45994

メッセージが異なる。

% cc -o sample sample.c -ledit
% cc -pg -o sample sample.c -ledit
/lib/libc.so.12: warning: warning: this program uses xdr_peername(), which is deprecated and buggy.
/lib/libc.so.12: warning: warning: __findenv is an internal obsolete function.
/lib/libc.so.12: warning: warning: this program uses xdr_mapname(), which is deprecated and buggy.
/lib/libc.so.12: warning: warning: this program uses xdr_domainname(), which is deprecated and buggy.
miwarin commented 9 years ago

以下2つがあると上記警告が表示される

-pg
-ledit
miwarin commented 9 years ago
-pg Generate extra code to write profile information suitable for the
    analysis program gprof.  You must use this option when compiling
    the source files you want data about, and you must also use it when
    linking.

Man page of GPROF

gprof は C, Pascal, Fortran77 プログラムの実行プロファイルを生成する。呼び出 されたルーチンの値は呼び出し元に取り込まれる。プロファイルのためのデー タはコール・グラフ (call graph: 関数コールの親子関係のグラフ) のプロファ イルデータファイル (デフォルトでは gmon.out') から取り 込まれる。このファイルは cc(1)、 pc(1)、 f77(1) で -pg オプションを指定してコンパイルされたプログラムによって作成される。 -pg オプションでは、リンクされるライブラリもプロファイル用にコンパイルされ たものになる。 gprof は指定されたオブジェクトファイル (デフォルトはa.out') からシンボ ルテーブルを読み、これと `gmon.out' のコール・グラフ・プロファイルとを 関連付ける。 複数のプロファイルデータファイルが指定された場合には、 gprof はそれらのプロファイル情報をすべて合計して表示する。

miwarin commented 9 years ago
-pg Generate extra code to write profile information suitable for the
    analysis program gprof.  You must use this option when compiling
    the source files you want data about, and you must also use it when
    linking.

Man page of GPROF

gprof は C, Pascal, Fortran77 プログラムの実行プロファイルを生成する。呼び出 されたルーチンの値は呼び出し元に取り込まれる。プロファイルのためのデー タはコール・グラフ (call graph: 関数コールの親子関係のグラフ) のプロファ イルデータファイル (デフォルトでは gmon.out') から取り 込まれる。このファイルは cc(1)、 pc(1)、 f77(1) で -pg オプションを指定してコンパイルされたプログラムによって作成される。 -pg オプションでは、リンクされるライブラリもプロファイル用にコンパイルされ たものになる。 gprof は指定されたオブジェクトファイル (デフォルトはa.out') からシンボ ルテーブルを読み、これと `gmon.out' のコール・グラフ・プロファイルとを 関連付ける。 複数のプロファイルデータファイルが指定された場合には、 gprof はそれらのプロファイル情報をすべて合計して表示する。

miwarin commented 9 years ago

この辺にたくさんある。

http://nxr.netbsd.org/source/xref/src/lib/libc/yp/xdryp.c#137

miwarin commented 9 years ago

FreeBSD はここ

https://svnweb.freebsd.org/base/head/lib/libc/yp/xdryp.c?view=log

このとき移動されたようだ

https://svnweb.freebsd.org/base?view=revision&revision=12816

miwarin commented 9 years ago

FreeBSD では yp と xdr が分離されている

https://svnweb.freebsd.org/base/head/lib/libc/xdr/

https://svnweb.freebsd.org/base/head/lib/libc/yp/

miwarin commented 9 years ago

マニュアル

On-line Manual of "xdr"

On-line Manual of "rpc"

Sun

付録 A XDR テクニカルノート (ONC+ 開発ガイド)

miwarin commented 9 years ago

XDR - Wikipedia

RFC4506 日本語訳 - [RFC/技術資料] ぺんたん info

RFC 4506 - XDR: External Data Representation Standard