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

Fixup for recent firmware inclusion changes #34

Merged
merged 3 commits into from
Feb 4, 2020

Conversation

jrmithdobbs
Copy link
Contributor

  • Minor fix for a bad check that clang (vs gcc) throws a warning for while building.
  • Add new msd/*.h and bin2c files to appropriate .gitignore locations.
  • Add implementation for fmemopen() for platforms that don't have it.

@ghollingworth ghollingworth merged commit 45c7237 into raspberrypi:master Feb 4, 2020
bencord0 pushed a commit to bencord0/rpiboot that referenced this pull request Nov 28, 2020
* Fix check against NULL for a static var actually looking for an empty c string.

* Update .gitignore for code change moving msd firmware to static vars.

* Fix support for OS X and *BSD after adding static vars for msd firmware.
deepcube added a commit to deepcube/usbboot that referenced this pull request Apr 21, 2022
Previously two commits added a fallback fmemopen for OS X/BSD that
didn't support fmemopen, then fixed some of the ifdef logic around it.
Unforunately the logic was backwards, as libc implementations do not
define _POSIX_C_SOURCE in order to advertise features.  Instead the
user defines _POSIX_C_SOURCE to control which definitions are
available.

At first glance _POSIX_VERSION could be tested to see if fmemopen
is available, but this only solves half the problem.  The fallback
implementation uses then non-standard BSD specific funopen.  This means
that even if _POSIX_VERSION is tested, there needs to be a way to
test for the existence of funopen.

Solve the problem with a short configure script that checks for
fmemopen and funopen.  This will work independent of which libc and
version are used.

Fixes: 45c7237 (Fixup for recent firmware inclusion changes (raspberrypi#34))
Fixes: 17f6b01 (Fix cross-platform building)
deepcube added a commit to deepcube/usbboot that referenced this pull request Apr 21, 2022
Previously two commits added a fallback fmemopen for OS X/BSD that
didn't support fmemopen, then fixed some of the ifdef logic around it.
Unforunately the logic was backwards, as libc implementations do not
define _POSIX_C_SOURCE in order to advertise features.  Instead the
user defines _POSIX_C_SOURCE to control which definitions are
available.

Check _POSIX_VERSION to see if the libc is new enough to implement
fmemopen.  If it is too old, assume that we're on a BSD compatible
system and use the fallback fmemopen that depends on funopen.
This solves the problem for some environments, but is still incorrect
as it will try to use the fallback even on a system that does not
include funopen.

Fixes: 45c7237 (Fixup for recent firmware inclusion changes (raspberrypi#34))
Fixes: 17f6b01 (Fix cross-platform building)
deepcube added a commit to deepcube/usbboot that referenced this pull request Apr 21, 2022
Previously two commits added a fallback fmemopen for OS X/BSD that
didn't support fmemopen, then fixed some of the ifdef logic around it.
Unforunately the logic was backwards, as libc implementations do not
define _POSIX_C_SOURCE in order to advertise features.  Instead the
user defines _POSIX_C_SOURCE to control which definitions are
available.

At first glance _POSIX_VERSION could be tested to see if fmemopen
is available, but this only solves half the problem.  The fallback
implementation uses then non-standard BSD specific funopen.  This means
that even if _POSIX_VERSION is tested, there needs to be a way to
test for the existence of funopen.

Solve the problem with a short configure script that checks for
fmemopen and funopen.  This will work independent of which libc and
version are used.

Fixes: 45c7237 (Fixup for recent firmware inclusion changes (raspberrypi#34))
Fixes: 17f6b01 (Fix cross-platform building)
pelwell pushed a commit that referenced this pull request Apr 22, 2022
Previously two commits added a fallback fmemopen for OS X/BSD that
didn't support fmemopen, then fixed some of the ifdef logic around it.
Unforunately the logic was backwards, as libc implementations do not
define _POSIX_C_SOURCE in order to advertise features.  Instead the
user defines _POSIX_C_SOURCE to control which definitions are
available.

Check _POSIX_VERSION to see if the libc is new enough to implement
fmemopen.  If it is too old, assume that we're on a BSD compatible
system and use the fallback fmemopen that depends on funopen.
This solves the problem for some environments, but is still incorrect
as it will try to use the fallback even on a system that does not
include funopen.

Fixes: 45c7237 (Fixup for recent firmware inclusion changes (#34))
Fixes: 17f6b01 (Fix cross-platform building)
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

Successfully merging this pull request may close these issues.

3 participants