2015-08-15 Sat

[別の年の同じ日: 2001 2002 2004 2006 2007 2008 2009 2010 2011

エンディアンを確認する はてぶ

メモ

- Linux: How to tell if system is big endian or little endian? - Server Fault
  http://serverfault.com/questions/163487/linux-how-to-tell-if-system-is-big-endian-or-little-endian

$ echo -n I | od -to2 | head -n1 | cut -f2 -d" " | cut -c6


を実行し、

- 出力が 0 -> ビッグエンディアン
- 出力が 1 -> リトルエンディアン

ということらしい。

[ Read More... ]

-fstack-protector とか はてぶ

いろいろビルドしていると、

- __stack_chk_fail_local
- __stack_chk_guard
- __stack_chk_fail

といった symbol が見つからなくて link できないことがある。

'__stack_chk_fail_local' が出た場合は
gcc に '-fno-stack-protector' を渡せばよいらしい。

'__stack_chk_guard' と '__stack_chk_fail' が出た場合は
gcc に '-fstack-protector' を渡せばよいらしい。

何に起因してこれらの symbol が埋め込まれるのかわかっていないのがつらい。

sys/isa_defs.h はてぶ

Solaris 上で h2o をビルドしてみようとしたところ、
libyrmcds のビルドで sys/endian.h がないと怒られる。

[ Read More... ]