my $linker = 0;
# Linker commands.
- if ($line =~ m{\s-o\s+ # -o
- (\\\s+)* # possible line continuation
+ if ($line =~ m{\s-o # -o
+ [\s\\]*\s+ # possible line continuation
([A-Za-z0-9_/.-]+/)? # path to file
[A-Za-z0-9_-]+ # binary name (no dots!)
(\.so([0-9.])*|\.la)? # library (including version)
gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.c
gcc -Wl,-z,relro -o test test-a.o test-b.o test-c.o\
-ltest
+gcc -o\
+test test-c.o test-a.o test-b.o\
+ -ltest
+gcc -o \
+test test-c.o test-b.o test-a.o\
+
+gcc -o \
+test test-b.o test-a.o test-c.c\
+
# Multiple commands in a single line.
gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -c test-a.c; gcc -D_FORTIFY_SOURCE=2 -c test-b.c
test \
test-a.o test-b.o test-c.o \
-ltest
+gcc \
+ -Wl,-z,relro \
+-o\
+test \
+ test-a.o test-b.o test-c.o \
+-ltest
+gcc \
+ -Wl,-z,relro \
+-o\
+ test\
+ test-a.o test-b.o test-c.o \
+-ltest
# Multiple commands in a single line.
gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c; gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
"CFLAGS missing (-Wformat): gcc \\ -g -O2 -fstack-protector\\ --param=ssp-buffer-size=4 -Wformat-security\\ -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
CFLAGS missing (--param=ssp-buffer-size=4): gcc -g -O2 -fstack-protector -Wformat -Wformat-security -Werror=format-security\\ -D_FORTIFY_SOURCE=2\\ -c test-b.c
CFLAGS missing (-Werror=format-security): gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.c
+LDFLAGS missing (-Wl,-z,relro): gcc -o\\ test test-c.o test-a.o test-b.o\\ -ltest
+LDFLAGS missing (-Wl,-z,relro): gcc -o \\ test test-c.o test-b.o test-a.o\\
+CFLAGS missing (-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc -o \\ test test-b.o test-a.o test-c.c\\
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -o \\ test test-b.o test-a.o test-c.c\\
+LDFLAGS missing (-Wl,-z,relro): gcc -o \\ test test-b.o test-a.o test-c.c\\
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -c test-a.c
CFLAGS missing (-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc -D_FORTIFY_SOURCE=2 -c test-b.c
CFLAGS missing (-Wformat-security -Werror=format-security): gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -D_FORTIFY_SOURCE=2 -c test-a.c