Bug 237159 - deskutils/sysctlview: fix build with GCC-based architectures
Summary: deskutils/sysctlview: fix build with GCC-based architectures
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Fernando Apesteguía
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-09 12:28 UTC by Piotr Kubaj
Modified: 2019-04-15 16:22 UTC (History)
3 users (show)

See Also:
alfix86: maintainer-feedback+


Attachments
patch (2.25 KB, patch)
2019-04-09 12:28 UTC, Piotr Kubaj
no flags Details | Diff
v2 (2.25 KB, patch)
2019-04-13 18:24 UTC, Piotr Kubaj
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj freebsd_committer 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 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 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 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 2019-04-13 18:24:26 UTC
Created attachment 203649 [details]
v2

Is that ok?
Comment 5 Alfonso S. Siciliano 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 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 2019-04-15 16:22:01 UTC
Committed,

Thanks!