Bug 231496 - devel/libubox: fix build on powerpc64
Summary: devel/libubox: fix build on powerpc64
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Martin Matuska
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-19 23:11 UTC by Piotr Kubaj
Modified: 2018-12-03 20:07 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (mm)


Attachments
patch (1.29 KB, patch)
2018-09-19 23:11 UTC, Piotr Kubaj
pkubaj: maintainer-approval? (mm)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj 2018-09-19 23:11:18 UTC
Created attachment 197248 [details]
patch

__is_constant macro is already defined in machine/endian.h. This patch renames this macro in libubox.

Tested on CURRENT with powerpc64 and amd64.
Comment 1 commit-hook freebsd_committer 2018-10-23 00:28:50 UTC
A commit references this bug:

Author: mm
Date: Tue Oct 23 00:28:15 UTC 2018
New revision: 482806
URL: https://svnweb.freebsd.org/changeset/ports/482806

Log:
  devel/libubox: fix build on powerpc64

  PR:		231496
  Submitted by:	Piotr Kubaj <pkubaj@anongoth.pl>

Changes:
  head/devel/libubox/Makefile
  head/devel/libubox/files/
  head/devel/libubox/files/patch-files_patch-utils.h
  head/devel/libubox/pkg-plist
Comment 2 Piotr Kubaj 2018-12-03 20:07:10 UTC
It looks like you just pasted a raw patch into files. This port still doesn't build :/

root@talos:$/usr/ports/devel/libubox$ cat files/patch-files_patch-utils.h
--- files/patch-utils.h.orig    2018-10-23 00:26:19 UTC
+++ files/patch-utils.h
@@ -0,0 +1,20 @@
+--- utils.h.orig       2018-09-19 23:05:31 UTC
++++ utils.h
+@@ -121,7 +121,7 @@ int clock_gettime(int type, struct timespec *tv);
+  * This returns a constant expression while determining if an argument is
+  * a constant expression, most importantly without evaluating the argument.
+  */
+-#define __is_constant(x)                                              \
++#define __is_it_constant(x)                                           \
+       (sizeof(int) == sizeof(*(1 ? ((void*)((long)(x) * 0l)) : (int*)1)))
+
+ #define __eval_once(func, x)                                          \
+@@ -136,7 +136,7 @@ int clock_gettime(int type, struct timespec *tv);
+ #define __eval_safe(func, x) __eval_once(func, x)
+ #else
+ #define __eval_safe(func, x)                                          \
+-      __builtin_choose_expr(__is_constant(x),                         \
++      __builtin_choose_expr(__is_it_constant(x),                      \
+                             func(x), __eval_once(func, x))
+ #endif
+