Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 06 Aug 2019 05:29:19 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 239669] fails to build valgrind
Message-ID:  <bug-239669-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D239669

            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@FreeBSD.org
          Reporter: naito.yuichiro@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=3D1 -DVGO_freebsd=3D1 -DVGP_x86_freebsd=3D1 -DVGPV_x86_freebsd_vanilla=
=3D1
-I../coreg
rind -DVG_LIBDIR=3D"\"/usr/local/lib/valgrind"\" -DVG_PLATFORM=3D"\"x86-fre=
ebsd\""
-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=20
-Wno-long-long
 -O2 -pipe -march=3Dskylake  -fstack-protector-strong -fno-strict-aliasing=
=20
-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/readel=
f.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) =3D=3D 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) =3D=3D 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) =3D=3D 0
                   && note.n_type =3D=3D 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.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-239669-227>