Bug 237159

Summary: deskutils/sysctlview: fix build with GCC-based architectures
Product: Ports & Packages Reporter: Piotr Kubaj <pkubaj>
Component: Individual Port(s)Assignee: Fernando ApesteguĂ­a <fernape>
Status: Closed FIXED    
Severity: Affects Only Me CC: asiciliano, fernape, linimon
Priority: --- Flags: asiciliano: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch
none
v2 none

Description Piotr Kubaj freebsd_committer freebsd_triage 2019-04-09 12:28:36 UTC
Created attachment 203541 [details]
patch

This port needs USES=compiler:c++11-lang. It also needs to not overwrite CXX, CXXFLAGS and LDFLAGS - this breaks build on GCC architectures.

When trying to build with GCC8: the following error happens:
mytreeview.cc:50:1: sorry, unimplemented: non-trivial designated initializers not supported

That's why we need to initialize variables the old way.

Tested on powerpc64 and amd64.
Comment 1 Alfonso S. Siciliano freebsd_committer freebsd_triage 2019-04-09 15:13:49 UTC
Thank you for your patch,

I am waiting a commit to 1.0 bug #236866, anyway
I have a core dump after the patch

/usr/ports/deskutils/sysctlview/# make install
% sysctlview
Segmentation fault (core dumped) 
% uname -a
FreeBSD fbsd 13.0-CURRENT FreeBSD 13.0-CURRENT r345315 GENERIC  amd64
% c++ --version
FreeBSD clang version 8.0.0 (branches/release_80 356034) (based on LLVM 8.0.0)
Target: x86_64-unknown-freebsd13.0
Thread model: posix
InstalledDir: /usr/bin

Please, could you confirm sysctlview is runnable? I used g++8, too.

Thanks,
Alfonso
Comment 2 Alfonso S. Siciliano freebsd_committer freebsd_triage 2019-04-09 15:23:27 UTC
Later, I will investigate:

++static const char *ctl_typename[CTLTYPE+1] = { "node", "integer", "string", "int64_t", "opaque", "unsigned integer", "long integer", "unsigned long", "uint64_t", "int8_t", "int16_t", "int32_t", "uint32_t" };

in sys/sysctl.h CTLTYPE_NODE is 1 not 0, I'll check the index of "node"

Regards,
Alfonso
Comment 3 Alfonso S. Siciliano freebsd_committer freebsd_triage 2019-04-09 15:46:17 UTC
Fixed, some 'type' was missing and added "ZEROUNUSED"

static const char *ctl_typename[CTLTYPE+1] = { "ZEROUNUSED", "node", "integer", "string", "int64_t", "opaque", "unsigned integer", "long integer", "unsigned long", "uint64_t", "uint8_t", "uint16_t", "int8_t","int16_t", "int32_t", "uint32_t" };

Please could you re-patch and re-test?

Thanks,
Alfonso
Comment 4 Piotr Kubaj freebsd_committer freebsd_triage 2019-04-13 18:24:26 UTC
Created attachment 203649 [details]
v2

Is that ok?
Comment 5 Alfonso S. Siciliano freebsd_committer freebsd_triage 2019-04-14 15:59:23 UTC
(In reply to Piotr Kubaj from comment #4)

It seems OK (maybe "PORTREVISION= 1" before to commit).

( upstream fix for the next version https://gitlab.com/alfix/sysctlview/commit/94b7016aabb605d1d19c291910dc4d3f64d96a0e )


Alfonso
Comment 6 commit-hook freebsd_committer freebsd_triage 2019-04-15 16:21:03 UTC
A commit references this bug:

Author: fernape
Date: Mon Apr 15 16:20:23 UTC 2019
New revision: 499030
URL: https://svnweb.freebsd.org/changeset/ports/499030

Log:
  deskutils/sysctlview: fix build with GCC-based architectures

  PR:     237159
  Submitted by:   pkubaj@anongoth.pl
  Approved by:    alfix86@gmail.com (maintainer)

Changes:
  head/deskutils/sysctlview/Makefile
  head/deskutils/sysctlview/files/
  head/deskutils/sysctlview/files/patch-mytreeview.cc
Comment 7 Fernando ApesteguĂ­a freebsd_committer freebsd_triage 2019-04-15 16:22:01 UTC
Committed,

Thanks!