Build palemoon-asan on ubuntu20.04

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
djinn
Newbie
Newbie
Posts: 3
Joined: 2022-04-12, 07:40

Build palemoon-asan on ubuntu20.04

Unread post by djinn » 2022-04-12, 07:46

When I ran the command './mach build' , it met the error: cannot find project browser. What's the problem?

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

Re: Build palemoon-asan on ubuntu20.04

Unread post by Moonchild » 2022-04-12, 10:50

You should use '--enable-application=palemoon'

I'm not sure if ASAN will build, but if it does, do let me know.
"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
djinn
Newbie
Newbie
Posts: 3
Joined: 2022-04-12, 07:40

Re: Build palemoon-asan on ubuntu20.04

Unread post by djinn » 2022-04-14, 02:14

I'm sorry that I met another problem. And the build log shows:
``` /home/wy/browser/palemoon/platform/toolkit/components/protobuf/src/google/protobuf/descriptor.pb.cc:9081:12: required from here
0:04.61 /home/wy/browser/palemoon/obj-x86_64-pc-linux-gnu/dist/include/google/protobuf/generated_message_reflection.h:496:10: error: ‘dynamic_cast’ not permitted with ‘-fno-rtti’
0:04.72 libipc_dbus.a.desc
0:05.31
0:05.31 In the directory /home/wy/browser/palemoon/obj-x86_64-pc-linux-gnu/toolkit/components/protobuf
0:05.31 The following command failed to execute properly:
/usr/bin/g++ -std=gnu++11 -o Unified_cpp_components_protobuf0.o -c -I/home/wy/browser/palemoon/obj-x86_64-pc-linux-gnu/dist/stl_wrappers -I/home/wy/browser/palemoon/obj-x86_64-pc-linux-gnu/dist/system_wrappers -include /home/wy/browser/palemoon/platform/config/gcc_hidden.h -DNDEBUG=1 -DTRIMMED=1 -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DHAVE_PTHREAD -DHAVE_ZLIB -DSTATIC_EXPORTABLE_JS_API -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -I/home/wy/browser/palemoon/platform/toolkit/components/protobuf -I/home/wy/browser/palemoon/obj-x86_64-pc-linux-gnu/toolkit/components/protobuf -I/home/wy/browser/palemoon/obj-x86_64-pc-linux-gnu/dist/include -I/home/wy/browser/palemoon/obj-x86_64-pc-linux-gnu/dist/include/nspr -I/home/wy/browser/palemoon/obj-x86_64-pc-linux-gnu/dist/include/nss -fPIC -DMOZILLA_CLIENT -include /home/wy/browser/palemoon/obj-x86_64-pc-linux-gnu/mozilla-config.h -MD -MP -MF .deps/Unified_cpp_components_protobuf0.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 -Wno-error=multistatement-macros -flifetime-dse=1 -fsanitize=address -fno-exceptions -fno-strict-aliasing -fno-rtti -fno-exceptions -fno-math-errno -msse2 -mfpmath=sse -pthread -pipe -g -O2 -w -fno-omit-frame-pointer -Wno-return-type -Wno-sign-compare -I/home/wy/browser/palemoon/platform/widget/gtk/compat -pthread -I/usr/include/gtk-2.0 -I/usr/include/gtk-unix-print-2.0 -I/usr/include/gtk-2.0 -I/usr/include/atk-1.0 -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/x86_64-linux-gnu -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include /home/wy/browser/palemoon/obj-x86_64-pc-linux-gnu/toolkit/components/protobuf/Unified_cpp_components_protobuf0.cpp
0:05.31 make[5]: *** [/home/wy/browser/palemoon/platform/config/rules.mk:881:Unified_cpp_components_protobuf0.o] 错误 1
0:05.31 make[4]: *** [/home/wy/browser/palemoon/platform/config/recurse.mk:71:toolkit/components/protobuf/target] 错误 2
0:05.31 make[4]: *** 正在等待未完成的任务....
0:05.85 libxpfe_components_directory.a.desc
0:06.59 libxpcom_reflect_xptinfo.a.desc
0:07.39 libdom_abort.a.desc
0:08.23 libnspr4.so
0:10.11 libdom_performance.a.desc
0:11.44 libxpcom_build.a.desc
0:12.08 libembedding_browser.a.desc
0:13.67 libdom_quota.a.desc
0:53.04 libmozsqlite3.so
0:53.15 make[3]: *** [/home/wy/browser/palemoon/platform/config/recurse.mk:33:compile] 错误 2
0:53.15 make[2]: *** [/home/wy/browser/palemoon/platform/config/rules.mk:493:default] 错误 2
0:53.15 make[1]: *** [/home/wy/browser/palemoon/client.mk:406:realbuild] 错误 2
0:53.15 make: *** [client.mk:164:build] 错误 2
0:53.16 0 compiler warnings present.
0:53.16 Failed to parse ccache stats output: stats updated Tue Apr 12 20:58:25 2022
wy@u20-browser:~/browser/palemoon$ cd /home/wy/browser/palemoon/obj-x86_64-pc-linux-gnu/toolkit/components/protobuf

I don't know how to fix it :sick:

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

Re: Build palemoon-asan on ubuntu20.04

Unread post by Moonchild » 2022-04-14, 10:52

It's a known issue that's been fixed on master -- we're still not sure why this actually didn't throw before.
You can fix this by applying the patch from Issue #1846 (UXP)
"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
djinn
Newbie
Newbie
Posts: 3
Joined: 2022-04-12, 07:40

Re: Build palemoon-asan on ubuntu20.04

Unread post by djinn » 2022-04-21, 09:50

Sorry, I met error again. The message is like this:

In file included from /home/fuzzer/temp/palemoon-asan/platform/xpcom/reflect/xptcall/xptcall.h:11,
10:39.19 from /home/fuzzer/temp/palemoon-asan/platform/xpcom/reflect/xptcall/xptcprivate.h:11,
10:39.19 from /home/fuzzer/temp/palemoon-asan/platform/xpcom/reflect/xptcall/md/unix/xptcinvoke_x86_64_unix.cpp:9:
10:39.19 /home/fuzzer/temp/palemoon-asan/obj-x86_64-pc-linux-gnu/dist/include/nscore.h:179:28: error: expected unqualified-id before string constant
10:39.19 #define NS_EXTERN_C extern "C"
10:39.19 ^~~
10:39.19 /home/fuzzer/temp/palemoon-asan/obj-x86_64-pc-linux-gnu/dist/include/nscore.h:184:32: note: in expansion of macro ‘NS_EXTERN_C’
10:39.19 #define EXPORT_XPCOM_API(type) NS_EXTERN_C NS_EXPORT type NS_FROZENCALL
10:39.19 ^~~~~~~~~~~
10:39.19 /home/fuzzer/temp/palemoon-asan/platform/xpcom/reflect/xptcall/md/unix/xptcinvoke_x86_64_unix.cpp:122:1: note: in expansion of macro ‘EXPORT_XPCOM_API’
10:39.19 EXPORT_XPCOM_API(nsresult)
10:39.19 ^~~~~~~~~~~~~~~~
10:39.20
10:39.22 In the directory /home/fuzzer/temp/palemoon-asan/obj-x86_64-pc-linux-gnu/xpcom/reflect/xptcall/md/unix
10:39.22 The following command failed to execute properly:
10:39.22 /usr/bin/g++ -std=gnu++11 -o xptcinvoke_x86_64_unix.o -c -I/home/fuzzer/temp/palemoon-asan/obj-x86_64-pc-linux-gnu/dist/stl_wrappers -I/home/fuzzer/temp/palemoon-asan/obj-x86_64-pc-linux-gnu/dist/system_wrappers -include /home/fuzzer/temp/palemoon-asan/platform/config/gcc_hidden.h -DDEBUG=1 -DTRACING=1 -DSTATIC_EXPORTABLE_JS_API -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -I/home/fuzzer/temp/palemoon-asan/platform/xpcom/reflect/xptcall/md/unix -I/home/fuzzer/temp/palemoon-asan/obj-x86_64-pc-linux-gnu/xpcom/reflect/xptcall/md/unix -I/home/fuzzer/temp/palemoon-asan/platform/xpcom/reflect/xptcall -I/home/fuzzer/temp/palemoon-asan/platform/xpcom/reflect/xptinfo -I/home/fuzzer/temp/palemoon-asan/obj-x86_64-pc-linux-gnu/dist/include -I/home/fuzzer/temp/palemoon-asan/obj-x86_64-pc-linux-gnu/dist/include/nspr -I/home/fuzzer/temp/palemoon-asan/obj-x86_64-pc-linux-gnu/dist/include/nss -fPIC -DMOZILLA_CLIENT -include /home/fuzzer/temp/palemoon-asan/obj-x86_64-pc-linux-gnu/mozilla-config.h -MD -MP -MF .deps/xptcinvoke_x86_64_unix.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 -Wno-error=multistatement-macros -flifetime-dse=1 -fsanitize=address -fno-exceptions -fno-strict-aliasing -fno-rtti -fno-exceptions -fno-math-errno -msse2 -mfpmath=sse -pthread -pipe -g -O2 -w -fno-omit-frame-pointer /home/fuzzer/temp/palemoon-asan/platform/xpcom/reflect/xptcall/md/unix/xptcinvoke_x86_64_unix.cpp


I think the #define statement is correct

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

Re: Build palemoon-asan on ubuntu20.04

Unread post by Moonchild » 2022-04-21, 10:12

A quick search in DDG (2 minutes) landed me on bug #1272498.
If you want to help fix ASAN builds, please port that bug to UXP (should be trivial) and submit a pull request on repo.palemoon.org - TIA!
"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

Locked