Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Jun 2020 23:20:08 +0000 (UTC)
From:      Adriaan de Groot <adridg@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r537511 - in head/devel/heaptrack: . files
Message-ID:  <202006012320.051NK8rY053244@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adridg
Date: Mon Jun  1 23:20:08 2020
New Revision: 537511
URL: https://svnweb.freebsd.org/changeset/ports/537511

Log:
  devel/heaptrack Try to fix 32-bit build
  
  I don't see that this can ever have built on 32-bit FreeBSD (i386
  in particular) because the code uses Sxword, which our elf32.h
  doesn't define. The Linux elf.h (which hanbles both sizes) does
  define a 64-bit Sxword.
  
  The patch throws in a using (typedef, but C++-style) that mimics
  the 64-bit integers used in the Linux headers; this 64-bit value
  doesn't match the size of Elf32_Dyn fields in either OS, but
  I'll take a warning over non-stop build failures any day.

Added:
  head/devel/heaptrack/files/
  head/devel/heaptrack/files/patch-src_track_heaptrack__inject.cpp   (contents, props changed)
Modified:
  head/devel/heaptrack/Makefile

Modified: head/devel/heaptrack/Makefile
==============================================================================
--- head/devel/heaptrack/Makefile	Mon Jun  1 22:03:23 2020	(r537510)
+++ head/devel/heaptrack/Makefile	Mon Jun  1 23:20:08 2020	(r537511)
@@ -4,6 +4,7 @@ PORTNAME=	heaptrack
 DISTVERSIONPREFIX=	v
 DISTVERSION=	1.1.0-179
 DISTVERSIONSUFFIX=	-gb0f8f2d
+PORTREVISION=	1
 CATEGORIES=	devel kde
 
 MAINTAINER=	kde@FreeBSD.org

Added: head/devel/heaptrack/files/patch-src_track_heaptrack__inject.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/heaptrack/files/patch-src_track_heaptrack__inject.cpp	Mon Jun  1 23:20:08 2020	(r537511)
@@ -0,0 +1,21 @@
+--- src/track/heaptrack_inject.cpp.orig	2020-06-01 22:47:27 UTC
++++ src/track/heaptrack_inject.cpp
+@@ -66,8 +66,18 @@ using Dyn = ElfW(Dyn);
+ using Rel = ElfW(Rel);
+ using Rela = ElfW(Rela);
+ using Sym = ElfW(Sym);
++#if __WORDSIZE == 64
+ using Sxword = ElfW(Sxword);
+ using Xword = ElfW(Xword);
++#else
++// FreeBSD elf32.h doesn't define Elf32_Sxword or _Xword. This is used in struct
++// elftable, where it's used as a tag value. Our Elf32_Dyn uses Elf32_Sword there,
++// as does the Linux definition (and the standard); the El64_Dyn uses Sxword.
++//
++// Linux elf.h defines Elf32_Sxword as a 64-bit quantity, so let's do that
++using Sxword = int64_t;
++using Xword = uint64_t;
++#endif
+ }
+ 
+ void overwrite_symbols() noexcept;



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