Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#54474 closed defect (fixed)

expat 2.2.2 fails to build on Snow Leopard -- missing arc4random_buf

Reported by: gnw3 Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.4.1
Keywords: snowleopard leopard tiger Cc: udbraumann, ballapete (Peter "Pete" Dyballa), devernay (Frédéric Devernay), rlhamil
Port: expat

Description

lib/xmlparse.c:56:3: error: #error You do not have support for any sources of high quality entropy enabled. For end user security, that is probably not what you want. Your options include:
 * Linux + glibc >=2.25 (getrandom): HAVE_GETRANDOM,
 * Linux + glibc <2.25 (syscall SYS_getrandom): HAVE_SYSCALL_GETRANDOM, 
 * BSD / macOS (arc4random_buf): HAVE_ARC4RANDOM_BUF,
 * libbsd (arc4random_buf): HAVE_ARC4RANDOM_BUF + HAVE_LIBBSD,
 * Windows (RtlGenRandom): _WIN32. 
If insist on not using any of these, bypass this error by defining XML_POOR_ENTROPY; you have been warned. For CMake, one way to pass the define is: cmake -DCMAKE_C_FLAGS="-pipe -O2 -DHAVE_SYSCALL_GETRANDOM" . If you have reasons to patch this detection code away or need changes to the build system, please open a bug. Thank you!

A workaround is to append -DXML_POOR_ENTROPY to CPPFLAGS in the generated Makefile.

Attachments (2)

main.log (18.0 KB) - added by ballapete (Peter "Pete" Dyballa) 7 years ago.
main.log from PPC Tiger
Makefile-XML_POOR_ENTROPY.patch (392 bytes) - added by ballapete (Peter "Pete" Dyballa) 7 years ago.
Work around missing system functions

Download all attachments as: .zip

Change History (20)

comment:1 Changed 7 years ago by mf2k (Frank Schima)

Cc: ryandesign added; ryandesign@… removed
Keywords: snowleopard added
Owner: set to ryandesign
Status: newassigned

comment:2 Changed 7 years ago by udbraumann

Cc: udbraumann added

comment:3 Changed 7 years ago by udbraumann

The same error occurs on 10.5.8 PPC. Does it mean that the respective Xcode is too old to have an acceptable arc4random, or is it missing at all?

comment:4 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign removed
Keywords: leopard tiger added
Status: assignedaccepted

It's the operating system (not Xcode) that's missing arc4random_buf.

I'll see what we can do about this.

comment:5 Changed 7 years ago by udbraumann

Thanks. expat 2.2.1_1 however could be built on 10.5.8, so the requirements must have changed very recently.

comment:6 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

And, needless to mention, the same also happens on PPC Tiger, Mac OS X 10.4.11.

Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: main.log added

main.log from PPC Tiger

comment:7 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Cc: ballapete added

comment:8 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

The supplied patch file fixes the build of expat 2.2.2.

Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Work around missing system functions

comment:9 Changed 7 years ago by kencu (Ken)

Perhaps this is something that could/should be added to snowleopardfixes as well, to get the proper functionality.

arc4random.c is available on apple open source.

comment:10 in reply to:  9 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

Replying to kencu:

arc4random.c is available on apple open source.

The needed funktion is arc4random_buf().

comment:11 Changed 7 years ago by kencu (Ken)

Yep; that, and about 10 related, are all in that one C file.

comment:12 Changed 7 years ago by devernay (Frédéric Devernay)

Cc: devernay added

comment:13 Changed 7 years ago by rlhamil

Cc: rlhamil added

comment:14 in reply to:  8 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to ballapete:

The supplied patch file fixes the build of expat 2.2.2.

I don't want to add -DXML_POOR_ENTROPY unconditionally, only when building for 10.6 or earlier.

See also the upstream bug report and pull request that might solve this better in a future version of expat.

comment:15 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: acceptedclosed

In b2b6b1e03b126df77195029670197b7ce1396f32/macports-ports:

expat: Work around build failure on 10.6 and earlier

Acknowledge lack of arc4random_buf.

Closes: #54474

comment:16 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Has duplicate #54503.

comment:17 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

It built on Mac OS X 10.6.8, Snow Leopard.

comment:18 Changed 7 years ago by ballapete (Peter "Pete" Dyballa)

It also built on PPC Tiger, Mac OS X 10.4.11.

Note: See TracTickets for help on using tickets.