From: Huang Rui Date: Wed, 4 Dec 2013 07:56:10 +0000 (+0800) Subject: usb: tools: fix a regression issue that gcc can't link to pthread X-Git-Tag: v3.13-rc4~47^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb292ce222cb5ad5b8b3f9fc4b74b8109fb16c19;p=pandora-kernel.git usb: tools: fix a regression issue that gcc can't link to pthread Reproduce: ray@hr-bak:~/usb$ make -C tools/usb/ make: Entering directory `/home/ray/usb/tools/usb' gcc -Wall -Wextra -g -lpthread -I../include -o testusb testusb.c /tmp/cc0EMxfy.o: In function `main': /home/ray/usb/tools/usb/testusb.c:508: undefined reference to `pthread_create' /home/ray/usb/tools/usb/testusb.c:531: undefined reference to `pthread_join' collect2: error: ld returned 1 exit status make: *** [testusb] Error 1 make: Leaving directory `/home/ray/usb/tools/usb' Comments: In the latest version (4.7.3) of gcc compiler, it requres that libraries must follow the object or source files like below: "gcc hello.c -lpthread" instead of "gcc -lpthread hello.c" And it isn't encountered at gcc version 4.7.2. So this patch fix to move the pthread option after testusb.c. Signed-off-by: Huang Rui Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed