Doesn't build on FreeBSD Topic is solved

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
User avatar
pteros
Moongazer
Moongazer
Posts: 12
Joined: 2019-09-06, 15:06

Doesn't build on FreeBSD

Unread post by pteros » 2019-09-06, 16:06

Hello all,

I know FreeBSD is not supported, I gave it a try anyway. I used gcc7 (that should be the same as the linux one) and, after a couple of hours it stopped with:

Code: Select all

101:01.28 In the directory  /var/spool/palemoon/pmbuild/gfx/harfbuzz/src
101:01.29 The following command failed to execute properly:
101:01.29 /usr/local/bin/g++7 -std=gnu++11 -o hb-blob.o -c -I/var/spool/palemoon/pmbuild/dist/stl_wrappers -I/var/spool/palemoon/pmbuild/dist/system_wrappers -include /usr/local/src/UXP-PM28.7.0_Release/config/gcc_hidden.h -DNDEBUG=1 -DTRIMMED=1 -DPACKAGE_VERSION="moz" -DPACKAGE_BUGREPORT="http://bugzilla.mozilla.org/" -DHAVE_OT=1 -DHB_NO_MT -DHB_NO_UNICODE_FUNCS -UDEBUG -I/usr/local/src/UXP-PM28.7.0_Release/gfx/harfbuzz/src -I/var/spool/palemoon/pmbuild/gfx/harfbuzz/src -I/var/spool/palemoon/pmbuild/dist/include -I/var/spool/palemoon/pmbuild/dist/include/nspr -I/var/spool/palemoon/pmbuild/dist/include/nss -fPIC -DMOZILLA_CLIENT -include /var/spool/palemoon/pmbuild/mozilla-config.h -MD -MP -MF .deps/hb-blob.o.pp -Wall -Wc++11-compat -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wc++14-compat -Wc++1z-compat -Wimplicit-fallthrough -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -flifetime-dse=1 -fno-exceptions -fno-strict-aliasing -fno-rtti -fno-exceptions -fno-math-errno -msse2 -mfpmath=sse -pipe -g -O2 -fomit-frame-pointer -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include /usr/local/src/UXP-PM28.7.0_Release/gfx/harfbuzz/src/hb-blob.cc
101:01.29 gmake[5]: *** [/usr/local/src/UXP-PM28.7.0_Release/config/rules.mk:886: hb-blob.o] Error 1
It complains about snprintf not being defined, though <stdio.h> does define it even in FreeBSD.

This is what it says:

Code: Select all

[1567700729.296977, "build_output", {"line": "                 from /usr/local/src/UXP-PM28.7.0_Release/gfx/harfbuzz/src/hb-
blob.cc:32:"}]
[1567700729.297982, "build_output", {"line": "/var/spool/palemoon/pmbuild/dist/include/mozilla/throw_gcc.h: In function 'voi
d std::__throw_system_error(int)':"}]
[1567700729.298962, "build_output", {"line": "/var/spool/palemoon/pmbuild/dist/include/mozilla/throw_gcc.h:138:5: error: 'sn
printf' was not declared in this scope"}]
[1567700729.299921, "build_output", {"line": "     snprintf(error, sizeof(error)-1,"}]
[1567700729.300902, "build_output", {"line": "     ^~~~~~~~"}]
[1567700729.316168, "build_output", {"line": "/var/spool/palemoon/pmbuild/dist/include/mozilla/throw_gcc.h:138:5: note: sugg
ested alternative: 'sprintf'"}]
[1567700729.317396, "build_output", {"line": "     snprintf(error, sizeof(error)-1,"}]
[1567700729.318468, "build_output", {"line": "     ^~~~~~~~"}]
[1567700729.31958, "build_output", {"line": "     sprintf"}]
Any idea anyone?

Luciano.

User avatar
Isengrim
Board Warrior
Board Warrior
Posts: 1325
Joined: 2015-09-08, 22:54
Location: 127.0.0.1
Contact:

Re: Doesn't build on FreeBSD

Unread post by Isengrim » 2019-09-06, 19:04

What does your mozconfig look like? Are you building with the proper libraries or using system libraries?
a.k.a. Ascrod
Linux Mint 19.3 Cinnamon (64-bit), Debian Bullseye (64-bit), Windows 7 (64-bit)
"As long as there is someone who will appreciate the work involved in the creation, the effort is time well spent." ~ Tetsuzou Kamadani, Cave Story

User avatar
pteros
Moongazer
Moongazer
Posts: 12
Joined: 2019-09-06, 15:06

Re: Doesn't build on FreeBSD

Unread post by pteros » 2019-09-06, 20:51

well, this is my .mozconfig:

Code: Select all

mk_add_options AUTOCLOBBER=1
mk_add_options MOZ_OBJDIR=/var/spool/palemoon/pmbuild/
ac_add_options --enable-application=palemoon
 
ac_add_options --enable-optimize="-O2"
 
# Please see https://www.palemoon.org/redist.shtml for restrictions when using the official branding.
ac_add_options --enable-official-branding
export MOZILLA_OFFICIAL=1
 
ac_add_options --enable-default-toolkit=cairo-gtk2
ac_add_options --enable-jemalloc
ac_add_options --enable-strip
ac_add_options --with-pthreads
 
ac_add_options --disable-tests
ac_add_options --disable-eme
ac_add_options --disable-parental-controls
ac_add_options --disable-accessibility
ac_add_options --disable-webrtc
ac_add_options --disable-gamepad
ac_add_options --disable-necko-wifi
ac_add_options --disable-updater
 
ac_add_options --x-libraries=/usr/lib

ac_add_options --prefix="/usr/local"
export MAKE=gmake
export ac_cv_path_PERL=/usr/local/bin/perl
export ac_cv_path_PERL_PATH=/usr/local/bin/perl
export PKG_CONFIG=pkgconf
export SHELL=/bin/sh
export CONFIG_SHELL=/bin/sh
export PERL="/usr/local/bin/perl"

export CC=gcc7
export CXX=g++7
export CPP=cpp7

mk_add_options AUTOCONF=autoconf-2.13

I haven't done anything special about libraryies, as far as I can tell...

Luciano.

User avatar
pteros
Moongazer
Moongazer
Posts: 12
Joined: 2019-09-06, 15:06

Re: Doesn't build on FreeBSD

Unread post by pteros » 2019-11-10, 10:53

28.7.2 Builds even with gcc9.

Unfortunately, it coredumps in malloc afeter the first strdup().

I'll give it another try with different compilers, just in case it changes something, but I'm not optimist...

Luciano.

New Tobin Paradigm

Re: Doesn't build on FreeBSD

Unread post by New Tobin Paradigm » 2019-11-10, 18:09

We don't really support BSD so it may not ever build and run well. It is not a priority.

Assuming we don't rip it out.

User avatar
pteros
Moongazer
Moongazer
Posts: 12
Joined: 2019-09-06, 15:06

Re: Doesn't build on FreeBSD

Unread post by pteros » 2019-11-10, 21:10

Of course I know it is not supported.

I'm OK with the MacOs version at home. I think expanding the scope of Palemoon to other platforms (I use FreeBSD at work) *might* be at least worth a try.

Just my to cents,

Luciano.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35475
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Doesn't build on FreeBSD

Unread post by Moonchild » 2019-11-10, 22:02

You can thank the OpenBSD folks for our "active lack of interest" in BSD platforms.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
pteros
Moongazer
Moongazer
Posts: 12
Joined: 2019-09-06, 15:06

Re: Doesn't build on FreeBSD

Unread post by pteros » 2019-11-12, 13:24

Oooh, I see...

Unfortunately I'm just a FreeBSD user, I don't represent anyone but myself. :(

BTW, as far as I have real work @ my office, I will try anyway with low priority and report any findings there, just in case another FreeBSD user wants to try...

Thanks for the clarifying link,

Luciano.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35475
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Doesn't build on FreeBSD

Unread post by Moonchild » 2019-11-12, 14:57

pteros wrote:
2019-11-12, 13:24
Unfortunately I'm just a FreeBSD user, I don't represent anyone but myself. :(
I'm sorry to say that you're feeling the fallout from this. We have nothing against the users of these OSes, but won't be making any efforts to support them due to their governance.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
pteros
Moongazer
Moongazer
Posts: 12
Joined: 2019-09-06, 15:06

Re: Doesn't build on FreeBSD

Unread post by pteros » 2019-11-13, 13:55

pteros wrote:
2019-11-12, 13:24
I will try anyway with low priority and report any findings there, just in case another FreeBSD user wants to try...
With gcc7 it builds and starts (via ./mach run). It coredumps at the first click, it seems to have problems with system pthreads:

Code: Select all

(gdb) bt
#0  0x000000080130b9ba in thr_kill () from /lib/libc.so.7
#1  0x000000080130b984 in raise () from /lib/libc.so.7
#2  0x0000000805e3c74e in ?? () from /var/spool/palemoon/pmbuild/dist/bin/libxul.so
#3  0x0000000000000400 in ?? ()
#4  0x0000000000000000 in ?? ()

I'll try with clang9... :think:

Luciano.

New Tobin Paradigm

Re: Doesn't build on FreeBSD

Unread post by New Tobin Paradigm » 2019-11-13, 16:56

The codebase isn't really designed to build with clang except in the context of MacOS X.

Face it, you're out of luck.

User avatar
Gaming4JC
Hobby Astronomer
Hobby Astronomer
Posts: 21
Joined: 2018-09-08, 17:10

Re: Doesn't build on FreeBSD

Unread post by Gaming4JC » 2019-11-28, 15:34

I have been experimenting with this since another user was asking about it and we might eventually support some form of BSD in Iceweasel-UXP.
However, it likely won't be FreeBSD since I find their code quality inferior and bloated.

Current situation:
  • Rudimentary build, can surf and runs fine, but no frills.
  • Requires latest FreeBSD 12.1 to avoid harfbuzz linker bug
  • System Hunspell doesn't work (use in-tree lib)
  • Audio doesn't work (likely fixable but requires sndio enforcement in libcubeb which breaks Windows and will never be accepted upstream as-is). See UXP Bug #1267
  • In-tree Jemalloc is badly busted when used with FreeBSD, this has been known since forever even in Firefox. Mozilla decided the best course of action was delete all the dead code and remove support for FreeBSD nearly completely in jemalloc - which is fine since it never worked and would need to be rewritten anyway. See m-c 115683 (Bustage) and m-c 1365191 (Code Cleanup).
  • Requires a few missing ifdefs in IPC code to unbust libevent. See this patch
Using the following .mozconfig and the IPC patch on FreeBSD 12.1 should be a starting point for someone who wants to work on it.

Code: Select all

ac_add_options --enable-application=application/basilisk

ac_add_options --with-pthreads

# Disable all non-essential components
ac_add_options --disable-accessibility
ac_add_options --disable-alsa
ac_add_options --disable-cpp-rtti
ac_add_options --disable-crashreporter
ac_add_options --disable-dbus
ac_add_options --disable-necko-wifi
ac_add_options --disable-negotiateauth
ac_add_options --disable-official-branding
ac_add_options --disable-pulseaudio
# needs patch-work leaving disabled
#ac_add_options --enable-sndio 
ac_add_options --disable-updater
ac_add_options --disable-webrtc
ac_add_options --disable-safe-browsing
ac_add_options --disable-url-classifier

# required due to m-c bug 1153683
# will build and crash on startup due to infinite recursion if not set.
ac_add_options --disable-jemalloc 

# Working system libs
ac_add_options --with-system-icu
ac_add_options --with-system-jpeg
ac_add_options --with-system-zlib
ac_add_options --with-system-bz2
ac_add_options --with-system-libvpx

# Broken system libs
#ac_add_options --enable-system-hunspell
#ac_add_options --enable-system-ffi
#ac_add_options --enable-system-pixman
#ac_add_options --enable-system-sqlite

ac_add_options --enable-default-toolkit=cairo-gtk2

Proof:
Image

(Note: I am also using debug build in this case, which requires two minor patches in spidermonkey to work in current trunk and is not related to FreeBSD development)

New Tobin Paradigm

Re: Doesn't build on FreeBSD

Unread post by New Tobin Paradigm » 2019-11-28, 15:41

Fucking disgusting on every level. Someone remind me to push for removing all non-mac BSD code from UXP.

User avatar
pteros
Moongazer
Moongazer
Posts: 12
Joined: 2019-09-06, 15:06

Re: Doesn't build on FreeBSD

Unread post by pteros » 2019-12-02, 17:36

Gaming4JC wrote:
2019-11-28, 15:34

Using the following .mozconfig and the IPC patch on FreeBSD 12.1 should be a starting point for someone who wants to work on it.
Thanks!

I'll give it a try as soon as I finish to upgrade my FreeBSD desktop to 12.1..

Luciano.

Locked