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

osreldate.h doesn't exist on PlayStation #12107

Closed
fffaraz opened this issue Oct 13, 2023 · 10 comments
Closed

osreldate.h doesn't exist on PlayStation #12107

fffaraz opened this issue Oct 13, 2023 · 10 comments
Assignees
Labels

Comments

@fffaraz
Copy link
Contributor

fffaraz commented Oct 13, 2023

I did this

Build fails on PlayStation due to missing osreldate.h

I expected the following

No response

curl/libcurl version

curl 8.4.0

operating system

PlayStation

@jay jay added the build label Oct 13, 2023
@jay
Copy link
Member

jay commented Oct 13, 2023

curl/include/curl/curl.h

Lines 68 to 71 in d755a5f

#if (defined(__FreeBSD__) && (__FreeBSD__ >= 2)) || defined(__MidnightBSD__)
/* Needed for __FreeBSD_version or __MidnightBSD_version symbol definition */
#include <osreldate.h>
#endif

FreeBSD manual says use #include <sys/param.h>.

I'm not sure why we're using osreldate, maybe for legacy reasons. What version of FreeBSD are you using? What happens if you #include <sys/param.h>

@bagder
Copy link
Member

bagder commented Oct 13, 2023

The include was brought in 2009, apparently to fix a build with FreeBSD < v8: b89789d

bagder added a commit that referenced this issue Oct 13, 2023
Follow-up to b89789d. This header does not exist in all modern
versions.

Fixes #12107
Reported-by: Faraz Fallahi
@bagder
Copy link
Member

bagder commented Oct 13, 2023

Maybe #12109 ?

@emaste
Copy link

emaste commented Oct 13, 2023

osreldate.h should exist on any FreeBSD version, but sys/param.h is also fine for defining __FreeBSD_version.

Here's a rather recent commit I found when looking for details: freebsd/freebsd-src@90eaf4b

@Freaky
Copy link

Freaky commented Oct 13, 2023

FreeBSD manual also says to use osreldate.h, sysctl(3):

The userland release version is available from <osreldate.h>;
parse this file if you need to get the release version of the
currently installed userland.

It's used a fair bit by the base system, including this example of how to find the FreeBSD version.

@bagder
Copy link
Member

bagder commented Oct 13, 2023

Thank you both @emaste and @Freaky. This seems to rather imply that either @fffaraz's setup is bad somehow or Sony has done something "fun" for the PlayStation that requires a special take.

Either way, my take in 12109 seems incorrect.

@fffaraz
Copy link
Contributor Author

fffaraz commented Oct 13, 2023

PlayStation sdk does not have osreldate.h but it does have sys/param.h and it defines __FreeBSD_version as
#define __FreeBSD_version 900044 /* Master, propagated to newvers */

@dfandrich
Copy link
Contributor

FWIW, I checked a FreeBSD 6.2 image I have lying around and either sys/param.h or osreldate.h work fine to define __FreeBSD_version.

@Freaky
Copy link

Freaky commented Oct 13, 2023

osreldate.h is generated during the build, while sys/param.h is a static source of truth in the source tree, used by sys/conf/newvers.sh. Perhaps some setup step for the SDK's been missed?

bagder added a commit that referenced this issue Oct 14, 2023
Should things build on Playstation as well

Fixes #12107
Reported-by: Faraz Fallahi
@bagder
Copy link
Member

bagder commented Oct 14, 2023

Based on all the comments, I figure we can just include sys/param.h instead? I made #12123 for that.

@bagder bagder self-assigned this Oct 16, 2023
@bagder bagder closed this as completed in 0b6d9ac Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6 participants