2010年8月30日 星期一

git bisect

git bisect start

# Mark current commit as bad
git bisect bad

git bisect good some-commit-here

git bisect good / bad

git bisect reset

Git bisect – the awesome way to find the Mr. Bug commit
http://ivanz.com/2009/03/27/git-bisect-the-awesome-way-to-find-the-mr-bug-commit/

2010年8月18日 星期三

Cutting git history

Re: Cutting history
http://www.spinics.net/lists/git/msg134997.html

Thiago Macieira on #git provided the answer. You can do that with
grafts and git filter-branch. E.g. rewriting the history so that you
only have the 7 latest commits:

git rev-list HEAD | sed '7q;d' > .git/info/grafts &&
test -s .git/info/grafts &&
git filter-branch -f HEAD

2010年8月10日 星期二

undefined reference to `pcap_parse'

Re: [Wireshark-users] Compilation problems with CVS libpcap
http://www.mail-archive.com/wireshark-users@wireshark.org/msg04062.html

nm -po /usr/local/lib/libpcap.a | egrep pcap_parse


http://www.mail-archive.com/wireshark-users@wireshark.org/msg04063.html
nm prints:

/usr/local/lib/libpcap.a:gencode.o: U pcap_parse

http://www.mail-archive.com/wireshark-users@wireshark.org/msg04064.html
It means that the symbol is undefined, and there's a reference to it
from the file "grammar.o" in the library.

nm -po /usr/local/lib/libpcap.a | egrep grammar.o

http://www.mail-archive.com/wireshark-users@wireshark.org/msg04054.html
/usr/local/lib/libpcap.a:grammar.o: U pcap_strcasecmp
/usr/local/lib/libpcap.a:grammar.o:000000a0 T yyparse
/usr/local/lib/libpcap.a:grammar.o:00000004 C yynerrs
/usr/local/lib/libpcap.a:grammar.o:00000004 C yychar

http://www.mail-archive.com/wireshark-users@wireshark.org/msg04065.html
> /usr/local/lib/libpcap.a:grammar.o:000000a0 T yyparse

Well, *that's* annoying. That's supposed to be pcap_parse.

egrep YACC Makefile
which yacc
which bison
which lex
which flex

http://www.mail-archive.com/wireshark-users@wireshark.org/msg04053.html
egrep YACC Makefile:

YACC = bison -y -p pcap_
$(YACC) -d $<

which yacc:
/usr/bin/yacc

which bison:
/usr/bin/bison

which lex:
/usr/bin/lex

which flex:
/usr/bin/flex

http://www.mail-archive.com/wireshark-users@wireshark.org/msg04035.html
> YACC = bison -y -p pcap_

Well, that's what it's supposed to be, and that's supposed to cause the
generated grammar.c to define its functions with names beginning with
pcap_, not yy.

What happens if you go to the source directory for libpcap, do "make
clean", do "make", and then do "nm -po libpcap.a | egrep parse"?

Then it got fixed....

2010年8月5日 星期四

hidden symbol `XXX' in YYY is referenced by DSO; Nonrepresentable section on output

buildroot-2010.05 on FC9 (no issue alike with Ubuntu 8.04/10.4)

configure:3939: checking for initscr in -lncurses
configure:3974: arm-unknown-linux-uclibcgnueabi-gcc -O3 -pipe -Os -mtune=arm1136jf-s -march=armv6j -mabi=aapcs-linux -mfpu=vfp -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/arm-linux-le-uclibc-gcc-4.3.3-2010.05/usr/include -I/arm-linux-le-uclibc-gcc-4.3.3-2010.05/include --sysroot=/arm-linux-le-uclibc-gcc-4.3.3-2010.05/ -isysroot /arm-linux-le-uclibc-gcc-4.3.3-2010.05 -o conftest -O3 -pipe -Os -mtune=arm1136jf-s -march=armv6j -mabi=aapcs-linux -mfpu=vfp -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/arm-linux-le-uclibc-gcc-4.3.3-2010.05/usr/include -I/arm-linux-le-uclibc-gcc-4.3.3-2010.05/include --sysroot=/arm-linux-le-uclibc-gcc-4.3.3-2010.05/ -isysroot /arm-linux-le-uclibc-gcc-4.3.3-2010.05 -L/arm-linux-le-uclibc-gcc-4.3.3-2010.05/lib -L/arm-linux-le-uclibc-gcc-4.3.3-2010.05/usr/lib --sysroot=/arm-linux-le-uclibc-gcc-4.3.3-2010.05/ conftest.c -lncurses >&5
/arm-unknown-linux-uclibcgnueabi/bin/ld: conftest: hidden symbol `__aeabi_ddiv' in /arm-linux-le-uclibc-gcc-4.3.3-2010.05/usr/lib/gcc/arm-unknown-linux-uclibcgnueabi/4.3.3/libgcc.a(_muldivdf3.o) is referenced by DSO
/arm-unknown-linux-uclibcgnueabi/bin/ld: final link failed: Nonrepresentable section on output


how to compile these code(simple share library)
http://topic.csdn.net/u/20070112/14/7c180efb-91f3-44ec-a19f-e8334e7ae73a.html
-shared
-lshare


[linux-karma-devel] Nonrepresentable section on output - Suggestoin
http://www.mail-archive.com/linux-karma-devel@lists.sourceforge.net/msg00389.html
The answer in my case and likely in yours, is that you have invoked the "ld" loader explicitly instead of frontending it with gcc. If you replace ld with gcc -shared in the make where you build your shared library, then links against that library will not get the "Nonrepresentable section on output " as a result of including modules from non-shared libraries (.a archives).


hidden symbol `__aeabi_uidiv' in xxxx is referenced by DSO
http://tw.myblog.yahoo.com/stevegigijoe/article?mid=-2&next=145&l=a&fid=9
-lgcc_s


Surfing and cross-compiling glib for RunningBear
http://people.defora.org/~khorben/200903.html
In this case, the problem is usually solved by adding either "-l gcc" or "`gcc -print-libgcc-file-name`" to the linking flags (LDFLAGS). However, unlike my other regular platforms (i386, amd64, sparc64) here it wasn't enough. After a lot of head-banging (to be fair, it also comes from the music) I realized that this flag is necessary both when linking the libc *and* the final executable file.


[Linux] Ubuntu 底下編譯 ebtables 失敗
http://antontw.blogspot.com/2008/11/linux-ubuntu-ebtables.html

2010年8月4日 星期三

glibc libc.so is executable

glibc libc.so is executable

# /lib/libc.so.6
GNU C Library (Ubuntu EGLIBC 2.11.1-0ubuntu7) stable release version 2.11.1, by Roland McGrath et al.
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.4.3.
Compiled on a Linux >>2.6.24-27-server<< system on 2010-04-22.
Available extensions:
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
Native POSIX Threads Library by Ulrich Drepper et al
BIND-8.2.3-T5B
For bug reporting instructions, please see:
<http://www.debian.org/Bugs/>.

but uclibc libc.so.0 isn't

2010年8月1日 星期日

新竹縣政府觀光休閒網-主題旅遊-自行車道

這篇本來只是要記資訊的....
不過越寫....越多抱怨...


中文版 只能用IE看,看品質應該是給豬看的....
日文版 IE, firefox皆可,應該是給人看的....
至於資訊呢...運氣好找的到(GPS位置、大小地圖、 720度環景)

運氣不好的什麼都沒有....

新竹縣政府觀光休閒網-主題旅遊-自行車道-竹北單車田野之旅
http://www.hsinchu.gov.tw/travel/modules/descovering/bike/detail.asp?Planid=404&pageno=4

再差點還有錯誤的GPS位置...

新竹縣政府觀光休閒網-主題旅遊-自行車道-新豐自行車海岸之旅
http://www.hsinchu.gov.tw/travel/modules/descovering/bike/detail.asp?Planid=387&pageno=4
GPS座標:E:247618 , N:2.7547
(這是哪??)

一整個不幸福的感覺....

新竹縣政府觀光休閒網-主題旅遊-自行車道
http://www.hsinchu.gov.tw/travel/modules/descovering/bike/default.asp

観光スポット情報 - 新竹県政府観光旅遊處
http://bilweb.hchg.gov.tw/hsinchutravel/content/travel/travel02.aspx?MType=4