This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PING 2][PATCH v3] Add pretty printers for the NPTL lock types
- From: Martin Galvan <martin dot galvan at tallertechnologies dot com>
- To: "Carlos O'Donell" <carlos at redhat dot com>
- Cc: Joseph Myers <joseph at codesourcery dot com>, Siddhesh Poyarekar <sid at reserved-bit dot com>, libc-alpha at sourceware dot org, Tom Tromey <tom at tromey dot com>, Torvald Riegel <triegel at redhat dot com>, Pedro Alves <palves at redhat dot com>, vapier at gentoo dot org, Daniel Gutson <daniel dot gutson at tallertechnologies dot com>
- Date: Mon, 21 Mar 2016 12:04:30 -0300
- Subject: Re: [PING 2][PATCH v3] Add pretty printers for the NPTL lock types
- Authentication-results: sourceware.org; auth=none
- References: <1447768994-5368-1-git-send-email-martin dot galvan at tallertechnologies dot com> <20160209155450 dot GE1904 at devel dot intra dot reserved-bit dot com> <CAOKbPbYPtn5mMpwGGD-HccXnhNz+eymiJ7Xwe_4WOnesYkw5=A at mail dot gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1602091743430 dot 29757 at digraph dot polyomino dot org dot uk> <CAOKbPba5MGw8XCXRSvapfADD1v_0FoVYhUeJUp01YBXyELLMkg at mail dot gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1602101301131 dot 23420 at digraph dot polyomino dot org dot uk> <56BCB9C7 dot 6000100 at redhat dot com> <CAOKbPbZMt+ozv8dPbC8hpZr6yw2d2HcV4OskRP+Pk-i3oYu=nQ at mail dot gmail dot com> <56D5DFE3 dot 5010401 at redhat dot com> <CAOKbPbY_TPXBuFWT_eZCOBKiF-uSWZndAT3cuL3ZvZF+htbCRQ at mail dot gmail dot com> <CAOKbPbY0QW-KvhegDbs3NCuv-hHKyf-peuL1aBon+YTCt2SfEg at mail dot gmail dot com> <56E249E9 dot 4060404 at redhat dot com> <CAOKbPbYXgQyM8Gk-R4poMsdHz6eZ6=9ynq=hu=E8yrignf3N-w at mail dot gmail dot com> <56E6FF80 dot 3080202 at redhat dot com> <CAOKbPbaVpUk0VggUGivbaY9fDHMf0-RrYjsYOGLRHEOKy+Ycbw at mail dot gmail dot com>
Hi again everyone,
I'm having some trouble when running 'make check' after placing the
pretty printers in their own directory. The Makefile looks like this:
subdir := pretty-printers
include ../Makeconfig
PYTHON := python
tests-pretty-printers := test-mutex-attributes test-mutex-printer \
test-condvar-attributes test-condvar-printer \
test-rwlock-attributes test-rwlock-printer
test-srcs := $(tests-pretty-printers)
CFLAGS-test-mutex-attributes.c := -O0 -ggdb3 -pthread
CFLAGS-test-mutex-printer.c := -O0 -ggdb3 -pthread
CFLAGS-test-condvar-attributes.c := -O0 -ggdb3 -pthread
CFLAGS-test-condvar-printer.c := -O0 -ggdb3 -pthread
CFLAGS-test-rwlock-attributes.c := -O0 -ggdb3 -pthread
CFLAGS-test-rwlock-printer.c := -O0 -ggdb3 -pthread
tests-pretty-printers-dest := $(addprefix $(objpfx), $(tests-pretty-printers))
tests-pretty-printers-pp := $(addsuffix -pp, $(tests-pretty-printers-dest))
ifeq ($(run-built-tests), yes)
tests-special += $(tests-pretty-printers-pp)
endif
include ../Rules
$(tests-pretty-printers-pp): $(objpfx)%-pp: $(objpfx)% %.py test_common.py
$(test-wrapper-env) $(PYTHON) $*.py $*.c $(objpfx)$*; \
$(evaluate-test)
I added the 'pretty-printers' subdir to the 'all-subdirs' variable in
Makeconfig. Whenever I run 'make check', however, I get the following
error:
make[2]: Entering directory `/home/martin/glibc/source/pretty-printers'
gcc test-mutex-attributes.c -c -std=gnu11 -fgnu89-inline
-fno-stack-protector -O2 -Wall -Werror -Wundef -Wwrite-strings
-fmerge-all-constants -frounding-math -g -Wstrict-prototypes
-Wold-style-definition -O0 -ggdb3 -pthread -U_FORTIFY_SOURCE
-I../include -I/home/martin/glibc/build/pretty-printers
-I/home/martin/glibc/build -I../sysdeps/unix/sysv/linux/x86_64/64
-I../sysdeps/unix/sysv/linux/x86_64 -I../sysdeps/unix/sysv/linux/x86
-I../sysdeps/unix/sysv/linux/wordsize-64 -I../sysdeps/x86_64/nptl
-I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux
-I../sysdeps/nptl -I../sysdeps/pthread -I../sysdeps/gnu
-I../sysdeps/unix/inet -I../sysdeps/unix/sysv
-I../sysdeps/unix/x86_64 -I../sysdeps/unix -I../sysdeps/posix
-I../sysdeps/x86_64/64 -I../sysdeps/x86_64/fpu/multiarch
-I../sysdeps/x86_64/fpu -I../sysdeps/x86/fpu/include
-I../sysdeps/x86/fpu -I../sysdeps/x86_64/multiarch
-I../sysdeps/x86_64 -I../sysdeps/x86 -I../sysdeps/ieee754/ldbl-96
-I../sysdeps/ieee754/dbl-64/wordsize-64 -I../sysdeps/ieee754/dbl-64
-I../sysdeps/ieee754/flt-32 -I../sysdeps/wordsize-64
-I../sysdeps/ieee754 -I../sysdeps/generic -I.. -I../libio -I.
-D_LIBC_REENTRANT -include /home/martin/glibc/build/libc-modules.h
-DMODULE_NAME=nonlib -include ../include/libc-symbols.h -o
/home/martin/glibc/build/pretty-printers/test-mutex-attributes.o -MD
-MP -MF /home/martin/glibc/build/pretty-printers/test-mutex-attributes.o.dt
-MT /home/martin/glibc/build/pretty-printers/test-mutex-attributes.o
In file included from ./../include/libc-symbols.h:58:0,
from <command-line>:0:
/home/martin/glibc/build/config.h:4:3: error: #error "glibc cannot be
compiled without optimization"
# error "glibc cannot be compiled without optimization"
^
Removing the "-O0" from CFLAGS-* in turn gives me the following error
when linking:
gcc -nostdlib -nostartfiles -o
/home/martin/glibc/build/pretty-printers/test-mutex-attributes
-Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both
/home/martin/glibc/build/csu/crt1.o
/home/martin/glibc/build/csu/crti.o `gcc
--print-file-name=crtbegin.o`
/home/martin/glibc/build/pretty-printers/test-mutex-attributes.o
-Wl,-dynamic-linker=/home/martin/glibc/install/lib/ld-linux-x86-64.so.2
-Wl,-rpath-link=/home/martin/glibc/build:/home/martin/glibc/build/math:/home/martin/glibc/build/elf:/home/martin/glibc/build/dlfcn:/home/martin/glibc/build/nss:/home/martin/glibc/build/nis:/home/martin/glibc/build/rt:/home/martin/glibc/build/resolv:/home/martin/glibc/build/crypt:/home/martin/glibc/build/mathvec:/home/martin/glibc/build/nptl
/home/martin/glibc/build/libc.so.6
/home/martin/glibc/build/libc_nonshared.a -Wl,--as-needed
/home/martin/glibc/build/elf/ld.so -Wl,--no-as-needed -lgcc
-Wl,--as-needed -lgcc_s -Wl,--no-as-needed `gcc
--print-file-name=crtend.o` /home/martin/glibc/build/csu/crtn.o
/home/martin/glibc/build/pretty-printers/test-mutex-attributes.o: In
function `main':
/home/martin/glibc/source/pretty-printers/test-mutex-attributes.c:42:
undefined reference to `pthread_mutexattr_init'
/home/martin/glibc/build/pretty-printers/test-mutex-attributes.o: In
function `test_settype':
/home/martin/glibc/source/pretty-printers/test-mutex-attributes.c:73:
undefined reference to `pthread_mutexattr_settype'
/home/martin/glibc/source/pretty-printers/test-mutex-attributes.c:75:
undefined reference to `pthread_mutexattr_settype'
/home/martin/glibc/source/pretty-printers/test-mutex-attributes.c:77:
undefined reference to `pthread_mutexattr_settype'
/home/martin/glibc/build/pretty-printers/test-mutex-attributes.o: In
function `test_setrobust':
/home/martin/glibc/source/pretty-printers/test-mutex-attributes.c:90:
undefined reference to `pthread_mutexattr_setrobust'
/home/martin/glibc/source/pretty-printers/test-mutex-attributes.c:92:
undefined reference to `pthread_mutexattr_setrobust'
/home/martin/glibc/build/pretty-printers/test-mutex-attributes.o: In
function `test_setpshared':
/home/martin/glibc/source/pretty-printers/test-mutex-attributes.c:105:
undefined reference to `pthread_mutexattr_setpshared'
/home/martin/glibc/source/pretty-printers/test-mutex-attributes.c:107:
undefined reference to `pthread_mutexattr_setpshared'
/home/martin/glibc/build/pretty-printers/test-mutex-attributes.o: In
function `test_setprotocol':
/home/martin/glibc/source/pretty-printers/test-mutex-attributes.c:122:
undefined reference to `pthread_mutexattr_setprotocol'
/home/martin/glibc/source/pretty-printers/test-mutex-attributes.c:124:
undefined reference to `pthread_mutexattr_setprotocol'
/home/martin/glibc/source/pretty-printers/test-mutex-attributes.c:126:
undefined reference to `pthread_mutex_setprioceiling'
/home/martin/glibc/source/pretty-printers/test-mutex-attributes.c:127:
undefined reference to `pthread_mutexattr_setprotocol'
collect2: error: ld returned 1 exit status
I know these two issues are probably unrelated to each other. However,
the weird thing here is that I had that exact same Makefile lines in
the NPTL Makefile, and there it always worked. Can anyone tell me what
exactly should I write in the new Makefile to make this work?
The alternative is to keep the printers in the NPTL subdir (which is
the only place they'll be used in anyway, at least for now), and solve
these issues in a future patch.