Bug 202020 - www/chromium fail to build with gcc
Summary: www/chromium fail to build with gcc
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-chromium (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-01 10:11 UTC by gja822
Modified: 2021-04-18 10:56 UTC (History)
3 users (show)

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


Attachments
should fix build on freebsd 9 (959 bytes, patch)
2015-08-04 01:17 UTC, Gary
no flags Details | Diff
should fix build on freebsd 9 (1.17 KB, patch)
2015-08-04 01:22 UTC, Gary
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description gja822 2015-08-01 10:11:39 UTC
Several last versions of www/chromium (up to latest 44.0.2403.125) won't build with gcc. If I try gcc-5.2.0, gcc_version is misread as "5" instead of "52", when I try gcc49 or gcc48, compilation stops with the following strange errors:


In file included from ../../third_party/ffmpeg/libavutil/autorename_libavutil_cpu.c:42:0:
/usr/include/sys/sysctl.h:801:25: error: unknown type name 'u_int'
 int sysctl(const int *, u_int, void *, size_t *, const void *, size_t);
                         ^
In file included from ../../third_party/ffmpeg/libavutil/autorename_libavutil_cpu.c:45:0:
/usr/local/lib/gcc49/gcc/x86_64-portbld-freebsd9.3/4.9.4/include-fixed/unistd.h:567:18: error: unknown type name 'fd_set'
 int  select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
                  ^
/usr/local/lib/gcc49/gcc/x86_64-portbld-freebsd9.3/4.9.4/include-fixed/unistd.h:567:28: error: unknown type name 'fd_set'
 int  select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
                            ^
/usr/local/lib/gcc49/gcc/x86_64-portbld-freebsd9.3/4.9.4/include-fixed/unistd.h:567:38: error: unknown type name 'fd_set'
 int  select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
                                      ^
/usr/local/lib/gcc49/gcc/x86_64-portbld-freebsd9.3/4.9.4/include-fixed/unistd.h:587:27: error: unknown type name 'u_long'
 int  strtofflags(char **, u_long *, u_long *);
                           ^
/usr/local/lib/gcc49/gcc/x86_64-portbld-freebsd9.3/4.9.4/include-fixed/unistd.h:587:37: error: unknown type name 'u_long'
 int  strtofflags(char **, u_long *, u_long *);
                                     ^
[331/17440] CC obj/third_party/ffmpeg/libavcodec/ffmpeg.h264pred.o
ninja: build stopped: subcommand failed.
Comment 1 gja822 2015-08-01 10:45:05 UTC
uname: FreeBSD 9.3-RELEASE-p13
Comment 2 Gary 2015-08-04 01:17:09 UTC
Created attachment 159512 [details]
should fix build on freebsd 9

With GCC 4.x, the problem is FreeBSD 9 sys/param.h file includes sys/types.h.  In third_party/ffmpeg/libavutil/autorename_libavutil_cpu.c, there is a 

#define __BSD_VISIBLE 1

that is too late as sys/types.h has already been included.

The attached patch to the port should fix it

note: compile tested only, haven't tried running the resulting binary yet
Comment 3 Gary 2015-08-04 01:22:43 UTC
Created attachment 159513 [details]
should fix build on freebsd 9

sorry, previous patch was wrong. this one should be better.
Comment 4 gja822 2015-08-04 18:59:28 UTC
1) Yes, now it can be built.

2) But not starting. No window shows, one process "chrome" hangs with 100% cpu utilization (and only -KILL kill'ing). With this output in gdb791:


[New Thread 817335800 (LWP 101243)]
^C
Program received signal SIGINT, Interrupt.
[Switching to Thread 817335800 (LWP 101243)]
0x000000080e36355c in ?? () from /lib/libthr.so.3
(gdb) where
#0  0x000000080e36355c in ?? () from /lib/libthr.so.3
#1  0x000000080e35d825 in ?? () from /lib/libthr.so.3
#2  0x000000080e36594d in ?? () from /lib/libthr.so.3
#3  0x0000000000bb1bf6 in ?? ()
#4  0x0000000000b8053e in ?? ()
#5  0x0000000000b5b8cc in ?? ()
#6  0x0000000000b6d330 in ?? ()
#7  0x0000000000b571ad in ?? ()
#8  0x0000000000b8d092 in ?? ()
#9  0x0000000000b87fee in ?? ()
#10 0x000000080e35bdc4 in ?? () from /lib/libthr.so.3
#11 0x0000000000000000 in ?? ()
Backtrace stopped: Cannot access memory at address 0x7ffffe3f2000


3) Now I'm on (hoped upgrade could make some use)
FreeBSD 9.3-RELEASE-p21 #6 r286180M
Comment 5 gja822 2015-08-05 20:54:41 UTC
Previous comment was about compiling with gcc49.

It occurs, that www/chromium works if compiled with gcc48 (at least after reboot).
Comment 6 commit-hook freebsd_committer freebsd_triage 2015-08-05 22:03:16 UTC
A commit references this bug:

Author: rene
Date: Wed Aug  5 22:02:53 UTC 2015
New revision: 393619
URL: https://svnweb.freebsd.org/changeset/ports/393619

Log:
  Fix build on FreeBSD 9.X

  PR:		202020
  Submitted by:	gja822@narod.ru
  MFH:		2015Q3

Changes:
  head/www/chromium/files/extra-patch-gcc
Comment 7 commit-hook freebsd_committer freebsd_triage 2015-08-05 22:08:18 UTC
A commit references this bug:

Author: rene
Date: Wed Aug  5 22:08:07 UTC 2015
New revision: 393621
URL: https://svnweb.freebsd.org/changeset/ports/393621

Log:
  MFH: r393619

  Fix build on FreeBSD 9.X

  PR:		202020
  Submitted by:	gja822@narod.ru
  Approved by:	ports-secteam (feld)

Changes:
_U  branches/2015Q3/
  branches/2015Q3/www/chromium/files/extra-patch-gcc
Comment 8 John James 2021-04-18 10:56:48 UTC
MARKED AS SPAM