Closed Bug 1674381 Opened 4 months ago Closed 3 months ago

update md/_openbsd.h (FTBFS on trunk ?)

Categories

(NSPR :: NSPR, defect)

Unspecified
OpenBSD
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gaston, Assigned: gaston)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

I've had a weird build failure with m-c on OpenBSD:

 2:40.57 In file included from Unified_c_external_nspr_pr1.c:110:                                                      
 2:40.57 /home/landry/src/m-c/nsprpub/pr/src/misc/prinit.c:168:5: error: implicit declaration of function '_MD_EarlyInit' is invalid in C99 [-Werror,-Wimplicit-function-declaration]                                                          
 2:40.57     _PR_MD_EARLY_INIT();                                                                                                                                                                                                              
 2:40.57     ^                                                                                                         
 2:40.57 /home/landry/src/m-c/nsprpub/pr/include/private/primpl.h:1889:30: note: expanded from macro '_PR_MD_EARLY_INIT'                                                                                                                       
 2:40.57 #define    _PR_MD_EARLY_INIT _MD_EARLY_INIT                                                                                                                                                                                           
 2:40.57                              ^                                                                                
 2:40.57 /home/landry/src/m-c/nsprpub/pr/include/md/_openbsd.h:193:41: note: expanded from macro '_MD_EARLY_INIT'                                                                                                                              
 2:40.57 #define _MD_EARLY_INIT                  _MD_EarlyInit                                                                                                                                                                                 
 2:40.57                                         ^              

after looking at the _netbsd.h and _freebsd.h headers, ours doesnt have this line

extern void _MD_EarlyInit(void);

also, now openbsd supports powerpc64 and aarch64 so maybe more defines should be added for those archs ? i havent been reported build failures of the NSPR port on those platform yet though, so dunno what codepath is used there.

there are other macros definitions pointing at extern functions which are defined for netbsd and freebsd (and not for openbsd) but apparently only this_MD_EarlyInit one matters.

The build failure doesnt happen on beta tarballs so maybe -Werror is off there.

i can of course add all the missing extern definitions, but what would be the preferred way to sync those between platforms ?

here's what i have now which allows me to build m-c, but there are still inconsistencies between platforms:

[19:05] c64:~/src/m-c/ $grep ^extern nsprpub/pr/include/md/_{linux,*bsd}.h
nsprpub/pr/include/md/_linux.h:extern PRInt32 _PR_x86_AtomicIncrement(PRInt32 *val);
nsprpub/pr/include/md/_linux.h:extern PRInt32 _PR_x86_AtomicDecrement(PRInt32 *val);
nsprpub/pr/include/md/_linux.h:extern PRInt32 _PR_x86_AtomicAdd(PRInt32 *ptr, PRInt32 val);
nsprpub/pr/include/md/_linux.h:extern PRInt32 _PR_x86_AtomicSet(PRInt32 *val, PRInt32 newval);
nsprpub/pr/include/md/_linux.h:extern PRInt32 _PR_ia64_AtomicIncrement(PRInt32 *val);
nsprpub/pr/include/md/_linux.h:extern PRInt32 _PR_ia64_AtomicDecrement(PRInt32 *val);
nsprpub/pr/include/md/_linux.h:extern PRInt32 _PR_ia64_AtomicAdd(PRInt32 *ptr, PRInt32 val);
nsprpub/pr/include/md/_linux.h:extern PRInt32 _PR_ia64_AtomicSet(PRInt32 *val, PRInt32 newval);
nsprpub/pr/include/md/_linux.h:extern PRInt32 _PR_x86_64_AtomicIncrement(PRInt32 *val);
nsprpub/pr/include/md/_linux.h:extern PRInt32 _PR_x86_64_AtomicDecrement(PRInt32 *val);
nsprpub/pr/include/md/_linux.h:extern PRInt32 _PR_x86_64_AtomicAdd(PRInt32 *ptr, PRInt32 val);
nsprpub/pr/include/md/_linux.h:extern PRInt32 _PR_x86_64_AtomicSet(PRInt32 *val, PRInt32 newval);
nsprpub/pr/include/md/_linux.h:extern PRInt32 _PR_ppc_AtomicIncrement(PRInt32 *val);
nsprpub/pr/include/md/_linux.h:extern PRInt32 _PR_ppc_AtomicDecrement(PRInt32 *val);
nsprpub/pr/include/md/_linux.h:extern PRInt32 _PR_ppc_AtomicAdd(PRInt32 *ptr, PRInt32 val);
nsprpub/pr/include/md/_linux.h:extern PRInt32 _PR_ppc_AtomicSet(PRInt32 *val, PRInt32 newval);
nsprpub/pr/include/md/_linux.h:extern void _MD_CleanupBeforeExit(void);
nsprpub/pr/include/md/_linux.h:extern PRStatus _MD_InitializeThread(PRThread *thread);
nsprpub/pr/include/md/_linux.h:extern PRStatus _MD_CREATE_THREAD(
nsprpub/pr/include/md/_linux.h:extern void _MD_SET_PRIORITY(struct _MDThread *thread, PRUintn newPri);
nsprpub/pr/include/md/_linux.h:extern PRStatus _MD_WAIT(PRThread *, PRIntervalTime timeout);
nsprpub/pr/include/md/_linux.h:extern PRStatus _MD_WAKEUP_WAITER(PRThread *);
nsprpub/pr/include/md/_linux.h:extern void _MD_YIELD(void);
nsprpub/pr/include/md/_linux.h:extern void _MD_EarlyInit(void);
nsprpub/pr/include/md/_linux.h:extern int __syscall_poll(struct pollfd *ufds, unsigned long int nfds,
nsprpub/pr/include/md/_linux.h:extern void _MD_linux_map_sendfile_error(int err);
nsprpub/pr/include/md/_freebsd.h:extern PRStatus _MD_InitializeThread(PRThread *thread);
nsprpub/pr/include/md/_freebsd.h:extern PRStatus _MD_CREATE_THREAD(
nsprpub/pr/include/md/_freebsd.h:extern void _MD_SET_PRIORITY(struct _MDThread *thread, PRUintn newPri);
nsprpub/pr/include/md/_freebsd.h:extern PRStatus _MD_WAIT(PRThread *, PRIntervalTime timeout);
nsprpub/pr/include/md/_freebsd.h:extern PRStatus _MD_WAKEUP_WAITER(PRThread *);
nsprpub/pr/include/md/_freebsd.h:extern void _MD_YIELD(void);
nsprpub/pr/include/md/_freebsd.h:extern void _MD_EarlyInit(void);
nsprpub/pr/include/md/_netbsd.h:extern void _MD_EarlyInit(void);
nsprpub/pr/include/md/_openbsd.h:extern void _MD_EarlyInit(void);

so i only added MD_EarlyInit, tweaked the list of platforms, but havent added all the ones from FreeBSD as i dunno if they matters.

Assignee: nobody → landry
Attachment #9185767 - Flags: review?(jjones)

The severity field is not set for this bug.
:KaiE, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(kaie)
Severity: -- → S4
Flags: needinfo?(kaie)

Comment on attachment 9185767 [details] [diff] [review]
nspr-md_openbsd.h.diff

im not sure if _PR_SI_ARCHITECTURE define matters much as not all the supported openbsd platforms listed on https://www.openbsd.org/plat.html appear in the define list (and i know that we have an nspr package on ppc64/arm64/mips64/mips64el), but m68k can go away for sure as it was deprecated after 5.1 years ago (per https://www.openbsd.org/mac68k.html)

Attachment #9185767 - Flags: review?(jc) → review?(kaie)

Comment on attachment 9185767 [details] [diff] [review]
nspr-md_openbsd.h.diff

I can only review this based on existing code.

The extern declaration looks good, the other BDS's do it the same way.

The #define statements match the ones found in _freebsd.h so it seems fine.

Attachment #9185767 - Flags: review?(kaie) → review+

I'll commit this change, but at this time we don't have any NSPR changes waiting for review - so it's unknown when it will be contained in a release.

Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 4.30

(In reply to Kai Engert (:KaiE:) from comment #6)

I'll commit this change, but at this time we don't have any NSPR changes waiting for review - so it's unknown when it will be contained in a release.

does this mean it'll only be updated in mozilla-central repo when an NSPR release is cut ?

thanks for landing the change anway !

Blocks: 1694371
You need to log in before you can comment on or make changes to this bug.