Skip to content

Commit

Permalink
tools/nolibc: Fix position of -lgcc in the documented example
Browse files Browse the repository at this point in the history
The documentation header in the nolibc.h file provides an example command
line, but it places the -lgcc argument before the source files, which
can fail with libgcc.a (e.g. on ARM when uidiv is needed). This commit
therefore moves the -lgcc to the end of the command line, hopefully
before this example leaks into makefiles.  This is a port of nolibc's
upstream commit b5e282089223 to the Linux kernel.

Fixes: 66b6f75 ("rcutorture: Import a copy of nolibc")
Tested-by: Valentin Schneider <valentin.schneider@arm.com>
Tested-by: Mark Rutland <mark.rutland@arm.com> [arm64]
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
  • Loading branch information
Willy Tarreau authored and Paul E. McKenney committed Jan 21, 2021
1 parent 35635d7 commit 3c6ce7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/include/nolibc/nolibc.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
*
* A simple static executable may be built this way :
* $ gcc -fno-asynchronous-unwind-tables -fno-ident -s -Os -nostdlib \
* -static -include nolibc.h -lgcc -o hello hello.c
* -static -include nolibc.h -o hello hello.c -lgcc
*
* A very useful calling convention table may be found here :
* http://man7.org/linux/man-pages/man2/syscall.2.html
Expand Down

0 comments on commit 3c6ce7a

Please sign in to comment.