[Bug 239669] fails to build valgrind

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Aug 6 05:29:20 UTC 2019


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239669

            Bug ID: 239669
           Summary: fails to build valgrind
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: bugs at FreeBSD.org
          Reporter: naito.yuichiro at gmail.com

Since r348628, FreeBSD head fails to build devel/valgrind as follows.
I believe this is not a port problem.

```
cc -DHAVE_CONFIG_H -I. -I..  -I.. -I../include -I../VEX/pub -I../VEX/pub
-DVGA_x
86=1 -DVGO_freebsd=1 -DVGP_x86_freebsd=1 -DVGPV_x86_freebsd_vanilla=1
-I../coreg
rind -DVG_LIBDIR="\"/usr/local/lib/valgrind"\" -DVG_PLATFORM="\"x86-freebsd\""
-B/usr/lib32 -m32 -O2 -g -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith
-Ws
trict-prototypes -Wmissing-declarations -Wno-format-zero-length
-Wno-tautologica
l-compare -fno-strict-aliasing -fno-builtin -fomit-frame-pointer 
-Wno-long-long
 -O2 -pipe -march=skylake  -fstack-protector-strong -fno-strict-aliasing 
-Wno-t
autological-compare -Wno-cast-align -Wno-self-assign -fno-stack-protector -MT
m_
debuginfo/libcoregrind_x86_freebsd_a-readelf.o -MD -MP -MF
m_debuginfo/.deps/lib
coregrind_x86_freebsd_a-readelf.Tpo -c -o
m_debuginfo/libcoregrind_x86_freebsd_a
-readelf.o `test -f 'm_debuginfo/readelf.c' || echo './'`m_debuginfo/readelf.c
In file included from m_debuginfo/readelf.c:35:
In file included from ./pub_core_vki.h:44:
In file included from ../include/pub_tool_vki.h:54:
../include/vki/vki-freebsd.h:1958:1: warning: typedef requires a name
      [-Wmissing-declarations]
typedef struct vki_i386_get_xfpustate {
^~~~~~~
../include/vki/vki-freebsd.h:1963:1: warning: typedef requires a name
      [-Wmissing-declarations]
typedef struct vki_amd64_get_xfpustate {
^~~~~~~
m_debuginfo/readelf.c:1094:54: error: use of undeclared identifier
      'ELF_NOTE_GNU'
               if (ML_(img_strcmp_c)(img, name_ioff, ELF_NOTE_GNU) == 0
                                                     ^
m_debuginfo/readelf.c:1134:54: error: use of undeclared identifier
      'ELF_NOTE_GNU'
               if (ML_(img_strcmp_c)(img, name_ioff, ELF_NOTE_GNU) == 0
                                                     ^
```

r348628 commit added

``` #define        NT_GNU_BUILD_ID         3 ```

in sys/elf_common.h.

In m_debuginfo/readelf.c of valgrind source,

```
#  ifdef NT_GNU_BUILD_ID
   if (is_elf_object_file_by_DiImage(img, rel_ok)) {
(snip)
               if (ML_(img_strcmp_c)(img, name_ioff, ELF_NOTE_GNU) == 0
                   && note.n_type == NT_GNU_BUILD_ID) {

```

ELF_NOTE_GNU is referenced if NT_GNU_BUILD_ID is defined,
but it is not defined in sys/elf_common.h.

I've tried to add

``` #define ELF_NOTE_GNU            "GNU" ```

in sys/elf_common.h. It works for me.

Please consider to add the definition.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list