pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Firefox on NetBSD



Hi,

Ryo ONODERA <ryo%tetera.org@localhost> writes:

> Hi,
>
> Ryo ONODERA <ryo%tetera.org@localhost> writes:
>
>> Hi,
>>
>> Jason Thorpe <thorpej%me.com@localhost> writes:
>>
>>>> On May 21, 2024, at 10:04 PM, Ryo ONODERA <ryo%tetera.org@localhost> wrote:
>>>
>>>> Under the latest NetBSD-current built from src tree without
>>>> the following commits, www/firefox-126.0 builds fine for me.
>>>> 
>>>> http://mail-index.netbsd.org/source-changes/2024/05/18/msg151444.html
>>>> http://mail-index.netbsd.org/source-changes/2024/05/18/msg151445.html
>>>> http://mail-index.netbsd.org/source-changes/2024/05/18/msg151446.html
>>>> 
>>>> I have no idea why these changes cause SIGILL.
>>>> 
>>>> Could you please investigate this problem, Jason?
>>>
>>> Anything that’s not supplied by the system that’s sensitive to __UCONTEXT_SIZE is broken by definition.
>>>
>>> What program is actually getting SIGILL?  What program did you have to rebuild after you made the change to sys/ucontext.h?
>>
>> rustc command invoked during pkgsrc/www/firefox gets SIGILL.
>>
>> I understand your upcoming changes need to expose __UCONTEXT_SIZE
>> to userland too.
>> Feel free to revert my recent change.
>
> I was confused.
>
> __UCONTEXT_SIZE is already visible from userland
> under NetBSD/amd64 at least.
> So '#ifdef __UCONTEXT_SIZE' is true and
> '#define __UCONTEXT_SIZE sizeof(ucontext_t)' is not defined
> for the userland of NetBSD/amd64-current for me.

Removing __CTASSERT() solves my problem.

CTASSERT(9) man page says:

IMPLEMENTATION NOTES
     The CTASSERT() macro should not be used in a header file.  It is
     implemented using a dummy typedef, with a name (based on line number)
     that may conflict with a CTASSERT() in a source file including that
     header.

If the man page says the correct description,
CTASSERT should be used in more careful way.

The following patch to r1.23 works for www/firefox with lang/rust for me.

Index: sys/sys/ucontext.h
===================================================================
RCS file: /cvsroot/src/sys/sys/ucontext.h,v
retrieving revision 1.23
diff -u -r1.23 ucontext.h
--- sys/sys/ucontext.h	24 May 2024 13:50:30 -0000	1.23
+++ sys/sys/ucontext.h	25 May 2024 05:26:26 -0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: ucontext.h,v 1.23 2024/05/24 13:50:30 ryoon Exp $	*/
+/*	$NetBSD: ucontext.h,v 1.22 2024/05/18 01:21:42 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2003, 2024 The NetBSD Foundation, Inc.
@@ -82,6 +82,12 @@
 #define _UC_UCONTEXT_ALIGN (~0)
 #endif
 
+#ifdef __UCONTEXT_SIZE
+//__CTASSERT(sizeof(ucontext_t) == __UCONTEXT_SIZE);
+#else
+#define	__UCONTEXT_SIZE		sizeof(ucontext_t)
+#endif
+
 #ifndef _UC_TLSBASE
 #error	_UC_TLSBASE not defined.
 #endif
@@ -102,12 +108,6 @@
 void	cpu_getmcontext(struct lwp *, mcontext_t *, unsigned int *);
 int	cpu_setmcontext(struct lwp *, const mcontext_t *, unsigned int);
 int	cpu_mcontext_validate(struct lwp *, const mcontext_t *);
-
-#ifdef __UCONTEXT_SIZE
-__CTASSERT(sizeof(ucontext_t) == __UCONTEXT_SIZE);
-#else
-#define	__UCONTEXT_SIZE		sizeof(ucontext_t)
-#endif
 #endif /* _KERNEL */
 
 #endif /* !_SYS_UCONTEXT_H_ */











>> I suspect that Rust's C binding may be implemented in bad manner.
>>
>> And I have found that rustc built under the latest kernel and userland
>> does not work with SIGILL, and I have replaced only userland with
>> a userland with my change, then rustc works fine.
>> So I suspect something in NetBSD userland is implemented in the bad manner.
>>
>> Thank you.
>>
>>>> 
>>>> Thank you.
>>>> 
>>>> 
>>>>> On Sun, May 19, 2024, 06:32 Robert Swindells <rjs%fdy2.co.uk@localhost> wrote:
>>>>> 
>>>>>> 
>>>>>> Is anyone else having problems building latest www/firefox on NetBSD?
>>>>>> 
>>>>>> Getting this kind of error:
>>>>>> 
>>>>>> gmake[2]: *** [/u23/pkgobj/www/firefox/work/firefox-126.0/config/
>>>>>> recurse.mk:72: _VERSION='' CARGO_PKG_VERSION=0.1.0
>>>>>> CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_
>>>>>> MINOR=1 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' DEBUG=false
>>>>>> HOST=x86_
>>>>>> 64-unknown-netbsd
>>>>>> LD_LIBRARY_PATH='/u23/pkgobj/www/firefox/work/build/release/de
>>>>>> 
>>>>>> ps:/u23/pkgobj/www/firefox/work/build/release:/usr/pkg/lib/rustlib/x86_64-unknow
>>>>>> n-netbsd/lib' NUM_JOBS=16 OPT_LEVEL=2
>>>>>> OUT_DIR=/u23/pkgobj/www/firefox/work/build
>>>>>> /x86_64-unknown-netbsd/release/build/gecko-profiler-1b4e9916b47d39e3/out
>>>>>> PROFILE
>>>>>> =release RUSTC=/usr/pkg/bin/rustc
>>>>>> RUSTC_LINKER=/u23/pkgobj/www/firefox/work/fire
>>>>>> fox-126.0/build/cargo-linker RUSTDOC=/usr/pkg/bin/rustdoc
>>>>>> TARGET=x86_64-unknown-
>>>>>> netbsd
>>>>>> /u23/pkgobj/www/firefox/work/build/release/build/gecko-profiler-beebe90b0
>>>>>> 6c32bf4/build-script-build` (signal: 4, SIGILL: illegal instruction)
>>>>>> 
>>>>>> Tried both lang/rust-bin and building rust from source on NetBSD-current
>>>>>> from today.
>>>>>> 
>>>>>> Firefox 125 built fine.
>>>>>> 
>>>> 
>>>> -- 
>>>> Ryo ONODERA // ryo%tetera.org@localhost
>>>> PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3
>>>
>>> -- thorpej
>>>
>>
>> -- 
>> Ryo ONODERA // ryo%tetera.org@localhost
>> PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3
>
> -- 
> Ryo ONODERA // ryo%tetera.org@localhost
> PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3

-- 
Ryo ONODERA // ryo%tetera.org@localhost
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3


Home | Main Index | Thread Index | Old Index