Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile] Error 2 on Alpine Linux #100

Open
nonvwvnon opened this issue Apr 13, 2022 · 12 comments
Open

compile] Error 2 on Alpine Linux #100

nonvwvnon opened this issue Apr 13, 2022 · 12 comments

Comments

@nonvwvnon
Copy link

platform: alpinelinux

File--
.mozconfig

mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-x86_64-unknown-linux-gnu

mk_add_options MOZ_MAKE_FLAGS="-s -j4"

ac_add_options --disable-crashreporter
ac_add_options --disable-tests
ac_add_options --disable-debug
ac_add_options --disable-updater
ac_add_options --disable-mozril-geoloc
ac_add_options --disable-webrtc
ac_add_options --disable-safe-browsing
ac_add_options --disable-parental-controls
ac_add_options --disable-release
ac_add_options --disable-necko-wifi
ac_add_options --disable-eme
ac_add_options --disable-gamepad
ac_add_options --disable-dbus
ac_add_options --disable-gio
ac_add_options --disable-pulseaudio
ac_add_options --enable-strip
ac_add_options --enable-install-strip
ac_add_options --enable-application=browser
ac_add_options --with-branding=browser/branding/arcticfox
ac_add_options --enable-optimize="-O2 -march=westmere"

./mach build

make[5]: Leaving directory '/root/Downloads/Arctic-Fox-39.1/obj-x86_64-unknown-linux-gnu/netwerk/ipc'
make[4]: Leaving directory '/root/Downloads/Arctic-Fox-39.1/obj-x86_64-unknown-linux-gnu'
make[3]: *** [/root/Downloads/Arctic-Fox-39.1/config/recurse.mk:33: compile] Error 2
make[3]: Leaving directory '/root/Downloads/Arctic-Fox-39.1/obj-x86_64-unknown-linux-gnu'
make[2]: *** [/root/Downloads/Arctic-Fox-39.1/config/rules.mk:548: default] Error 2
make[2]: Leaving directory '/root/Downloads/Arctic-Fox-39.1/obj-x86_64-unknown-linux-gnu'
make[1]: *** [/root/Downloads/Arctic-Fox-39.1/client.mk:399: realbuild] Error 2

@rmottola
Copy link
Owner

Your log is not very exhaustive, it does not show the effective error.

ArcticFox currently does not complete a build for me on AlpineLinux, it goes much further than your example shows, it blows up inside the spell checker, even if I use the system supplied one, I don't know why though.

What compiler are you using? Do you have python 2.7 and autoconf 2.13 installed?

@nonvwvnon
Copy link
Author

is there a file where arctic-fox can keep the compilation results to a log file ?

python 2.7.18 and autoconf 2.13 are both installed

.mozconfig file:

export CC=gcc
export CXX=g++
mk_add_options PYTHON=/usr/bin/python2
mk_add_options AUTOCONF=/usr/bin/autoconf-2.13

Clear this if not a 64bit build

_BUILD_64=1

Set GTK Version to 2 or 3

_GTK_VERSION=2

Standard build options for Pale Moon

ac_add_options --enable-application=palemoon
ac_add_options --enable-optimize="-O2 -w"
ac_add_options --enable-default-toolkit=cairo-gtk$_GTK_VERSION
ac_add_options --enable-jemalloc
ac_add_options --enable-strip
ac_add_options --enable-devtools
ac_add_options --enable-av1
ac_add_options --disable-gamepad
ac_add_options --disable-tests
ac_add_options --disable-debug
ac_add_options --disable-necko-wifi
ac_add_options --disable-updater
ac_add_options --disable-gconf
ac_add_options --with-pthreads

Please see https://www.palemoon.org/redist.shtml for restrictions when using the official brandin>

ac_add_options --enable-official-branding
export MOZILLA_OFFICIAL=1

Processor architecture specific build options

if [ -n "$_BUILD_64" ]; then
ac_add_options --x-libraries=/usr/lib64
else
ac_add_options --x-libraries=/usr/lib
fi

export MOZ_PKG_SPECIAL=gtk$_GTK_VERSION

@rmottola
Copy link
Owner

Current development branch is rmottola:dev, please test on that.

The build log and error show on std-out usually or can be retrieved with "mach show-log"

I use as optimization flags the following when compiling with gcc 6.5 or higher (does not affect compilation success, but will lead to crashing app)

ac_add_options --enable-optimize="-O2 -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-schedule-insns2"

and, to attempt work around the hunspell issue:

# System libraries                                                                                                       
ac_add_options --with-system-nspr                                                                                        
ac_add_options --with-system-nss                                                                                         
ac_add_options --with-system-icu                                                                                         
ac_add_options --with-system-zlib                                                                                        
ac_add_options --with-system-bz2                                                                                         
ac_add_options --enable-system-hunspell                                                                                  
#ac_add_options --enable-system-sqlite                                                                                   
ac_add_options --enable-system-ffi                                                                                       
ac_add_options --enable-system-pixman                                                                                    

My attempts to build on alpine 3.15 on my dev branch with the above options fail with:

293:39.66 /home/multix/code/Arctic-Fox/xpcom/base/nsMemoryReporterManager.cpp:183:21: error: variable 'SystemHeapSize(int64_t*)::mallinfo info' has initializer but incomplete type
293:39.66   183 |     struct mallinfo info = mallinfo();
293:39.66       |                     ^~~~
293:39.67 /home/multix/code/Arctic-Fox/xpcom/base/nsMemoryReporterManager.cpp:183:37: error: invalid use of incomplete type 'struct SystemHeapSize(int64_t*)::mallinfo'
293:39.67   183 |     struct mallinfo info = mallinfo();
293:39.67       |                                     ^

@rmottola
Copy link
Owner

I fixed the mallinfo issue! I backported a specific fix

@nonvwvnon
Copy link
Author

i got a cannot find <sys/queue.h> while compile.
do you mind share your .mozconfig ? i will then try the compilation again.

@nonvwvnon
Copy link
Author

did you get a working articfox on alpinelinux 3.15?

@rmottola
Copy link
Owner

ac_add_options --enable-gold
ac_add_options --disable-crashreporter
ac_add_options --disable-tests
ac_add_options --disable-debug
ac_add_options --disable-updater
ac_add_options --disable-mozril-geoloc
ac_add_options --disable-webrtc
ac_add_options --disable-safe-browsing
ac_add_options --disable-parental-controls
ac_add_options --enable-release
ac_add_options --disable-necko-wifi
ac_add_options --disable-eme
ac_add_options --disable-gamepad
ac_add_options --disable-dbus
ac_add_options --disable-gio
ac_add_options --disable-pulseaudio
#ac_add_options --enable-strip
#ac_add_options --enable-install-strip
ac_add_options --enable-application=browser
ac_add_options --with-branding=browser/branding/arcticfox
ac_add_options --enable-optimize="-O2 -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-schedule-insns2"

ac_add_options --with-system-nspr
ac_add_options --with-system-nss
ac_add_options --with-system-icu
ac_add_options --with-system-zlib
ac_add_options --with-system-bz2
ac_add_options --enable-system-hunspell
#ac_add_options --enable-system-sqlite
ac_add_options --enable-system-ffi
ac_add_options --enable-system-pixman

@rmottola
Copy link
Owner

rmottola commented Jan 4, 2023

Did you try current? most fixes are in... but complete build fails tue to hunspell. I tried using system one, but it does not help (note options above).
Hints on AlpineLinux support welcomed

@rmottola
Copy link
Owner

@nonvwvnon could you try with current git?

@rmottola rmottola changed the title compile] Error 2 compile] Error 2 on Alpine Linux Dec 13, 2023
@awilfox
Copy link

awilfox commented Oct 22, 2024

Hi, I'm a maintainer of Adélie Linux which is a separate distro that also uses musl libc.

I have found the issue with hunspell. The allocator redirector #defines free. In mozilla/Logging.h you end up with:

class LogModule
{      
public:
  ~LogModule() { ::HunspellAllocator::CountingFree(mName); }

…which isn't helpful, and then later /usr/include/sched.h is pulled in, which:

void *memset (void *, int, size_t);
void *
# 84 "/usr/include/sched.h"
     HunspellAllocator::CountingCalloc(
# 84 "/usr/include/sched.h" 3 4
     size_t
# 84 "/usr/include/sched.h"
     ,
# 84 "/usr/include/sched.h" 3 4
     size_t
# 84 "/usr/include/sched.h"
     )
# 84 "/usr/include/sched.h" 3 4
                           ;

doesn't end well either.

@awilfox
Copy link

awilfox commented Oct 22, 2024

Looks like this patch fixes it:

--- Arctic-Fox-45.1/extensions/spellcheck/hunspell/glue/hunspell_alloc_hooks.h.old	2024-09-30 19:54:44.000000000 +0000
+++ Arctic-Fox-45.1/extensions/spellcheck/hunspell/glue/hunspell_alloc_hooks.h	2024-10-22 21:46:00.494798524 +0000
@@ -47,6 +47,8 @@
  * allocated using C memory allocation functions.
  */
 
+#include <sched.h>
+#include "mozilla/Logging.h"
 #include "mozilla/mozalloc.h"
 #include "mozHunspellAllocator.h"

Of course, I don't recommend this, because <sched.h> isn't needed on every platform, and probably isn't present on Windows or such.

@rmottola
Copy link
Owner

Is that your only change? Just out of curiosity I tried on OpenBSD and it did not help. There I stoo have issues with realloc and memory functions due to define macros.
#208

Still need to try on Alpine itself though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants