Bug 236248

Summary: graphics/mesa-dri build error
Product: Ports & Packages Reporter: nick.rozhkov
Component: Individual Port(s)Assignee: freebsd-x11 (Nobody) <x11>
Status: Closed FIXED    
Severity: Affects Only Me CC: dak.linux, nick.rozhkov, val, zeising
Priority: --- Flags: bugzilla: maintainer-feedback? (x11)
Version: Latest   
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
build.log none

Description nick.rozhkov 2019-03-05 13:23:52 UTC
Created attachment 202577 [details]
build.log

graphics/mesa-dri port build constantly causes the error

Hardware configuration
uname - FreeBSD daemon.sanitarium.com.ua 12.0-RELEASE-p3 FreeBSD 12.0-RELEASE-p3 #1 r343954M: Sun Feb 10 13:43:21 UTC 2019
Minimal kernel, Nvidia GTX760 (latest Nvidia-driver from ports) + intel HD Graphics 530
(latest drm-kmod from ports)
Comment 1 nick.rozhkov 2019-03-05 13:28:58 UTC
graphics/mesa-dri options 
- all (VDPAU, VAAPI, WAYLAND) are disabled, but I tried to build it with all possible combinations - result is the same
Comment 2 Jan Beich freebsd_committer freebsd_triage 2019-03-05 16:23:22 UTC
> In file included from intel_tiled_memcpy_normal.c:33:
> ./intel_tiled_memcpy.c:68:1: error: expected ')'
> bswap32(uint32_t n)
> ^
> /usr/include/endian.h:62:20: note: expanded from macro 'bswap32'
> #define bswap32(x)      __bswap32(x)
>                         ^
> /usr/include/x86/endian.h:79:27: note: expanded from macro '__bswap32'
>         (__builtin_constant_p(x) ?      \
>                                  ^
> ./intel_tiled_memcpy.c:68:1: note: to match this '('

/usr/include/endian.h doesn't exist on any supported FreeBSD version.
Comment 3 nick.rozhkov 2019-03-05 18:17:15 UTC
(In reply to Jan Beich from comment #2)

Well your suggestion is not clear for me honestly.
Comment 4 Niclas Zeising freebsd_committer freebsd_triage 2019-03-06 21:41:47 UTC
I cannot reproduce this.

Do you have any non-default options set?
Have you built your FreeBSD with any special src.conf options?
Comment 5 nick.rozhkov 2019-03-08 13:13:32 UTC
(In reply to Niclas Zeising from comment #4)
Yep. Have the following /etc/src.conf

MALLOC_PRODUCTION=YES
WITHOUT_SENDMAIL=YES
LOADER_LUA=YES
WITH_LOADER_SIMP=YES
WITH_FORTH=YES 
LOADER_INTERP=lua
WITHOUT_DEBUG_FILES=YES

the /etc/make.conf is 
CPUTYPE?=native
DEFAULT_VERSIONS=gcc=8 samba=4.8 python=2.7 python2=2.7 python3=3.6 php=7.2 linux=c7 ruby=2.5 mysql=5.7 pgsql=11
DISABLE_VULNERABILITIES=yes
LOCALIZED_LANG=ru


Something similar to "endian.h doesn't exist on any supported FreeBSD version." I saw a couple weeks ago during the ports update (i'm using portupgrade for this purpose) but cant't recall how I fixed the problem

Currently llvm60-6.0.1_6 and llvm60-6.0.1_6 are installed in addition to system compiller.
Comment 6 Niclas Zeising freebsd_committer freebsd_triage 2019-03-08 15:00:50 UTC
(In reply to nick.rozhkov from comment #5)

Hi!
I don't know where you got /usr/include/endian.h from, do you have it in your file system where you are building?
FreeBSD has a /usr/src/sys/endian.h.

Can you try to compile without CPUTYPE and see what happens?
Comment 7 nick.rozhkov 2019-03-08 15:06:31 UTC
(In reply to Niclas Zeising from comment #6)
Yep. Removing CPUTYPE then and checking the /usr/include then. Big thanks for suggestion.
Comment 8 nick.rozhkov 2019-03-08 15:11:37 UTC
(In reply to Niclas Zeising from comment #6)

heh yep, found the endian.h in /usr/include. System was updated from previous version (12-CURRENT) via sources build but I definitely did old-libs and old remove after the update. Thanks for the suggestion one more time
Comment 9 Niclas Zeising freebsd_committer freebsd_triage 2019-03-08 15:17:48 UTC
(In reply to nick.rozhkov from comment #8)

Any clue where that file came from?  I don't think FreeBSD has had include/endian.h ever.
Comment 10 nick.rozhkov 2019-03-08 15:37:39 UTC
(In reply to Niclas Zeising from comment #9)
Nope, unfortunately no idea where it from. Removed it and doing the full system rebuild currently. Thanks for your time and for the help.
Comment 11 Val Packett 2019-03-09 12:18:54 UTC
(In reply to nick.rozhkov from comment #10)

There *will* be endian.h https://reviews.freebsd.org/D19500 by the way, but it shouldn't have been there yet
Comment 12 Niclas Zeising freebsd_committer freebsd_triage 2019-03-09 18:05:20 UTC
(In reply to Greg V from comment #11)

I asked for an exp-run for that change, just in case.  I don't think it will be trouble, but you never know.
Comment 13 nick.rozhkov 2019-03-09 21:08:49 UTC
Fixed. After endian remove mesa-dri builds as expected
Comment 14 nick.rozhkov 2019-03-09 21:09:16 UTC
Fixed
Comment 15 Davide Gessa 2019-07-16 10:53:45 UTC
I know the issue is closed, but I got the same problem today. 

I tried the solutions proposed in these comments but I was unable to fix: the problem was /usr/include/endian.h which refers to sys/endian.h, while mesa-dri needs x86/endian.h, so I moved away /usr/include/endian.h and the package has built without errors.

FreeBSD freebsd 12.0-RELEASE-p3 FreeBSD 12.0-RELEASE-p3 GENERIC  amd64
I don't have a make.conf file