-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Fix build errors on djgpp #19274
Fix build errors on djgpp #19274
Conversation
Build failed on djgpp due to missing config vars 'AR' and 'ARFLAGS'. Additionally, '-lz' was not added to 'lflags' when zlib support was enabled. Inheriting configuration variables from BASE_unix solves both these issues. CLA: trivial
This part failed to compile due to a circular dependency between internal/e_os.h and internal/time.h, when ossl_sleep() falls back to a busy wait. However, djgpp has a usleep function, so it can use the regular Unix version of ossl_sleep(). It's not great though. The resolution is only ~55ms, and it may break when a user program hooks the timer interrupt without periodically updating BIOS time. A high-resolution alternative is uclock(), but that is generally less desirable since it reprograms the system timer. The circular dependency is still there and may still cause trouble for other platforms. CLA: trivial
If this macro is left undefined, Watt-32 will "helpfully" declare some typedefs such as 'byte' and 'word' in the global namespace. This broke compilation of apps/s_client.c. CLA: trivial
I marked this for the 3.0 branch, 'cause I think of this as bug fixes and that they should thus be backported. I'm unsure, though, if this applies cleanly on that branch, it's possible that a separate PR is needed. It may be that the same reasoning should be made for 1.1.1. Is this something you're willing to look into, @jwt27? |
1.1.1 is receiving security fixes only - so this would not be backported there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately at least the last commit is outside of what we would accept with CLA: trivial. Can you please sign the regular CLA? https://www.openssl.org/policies/cla.html
Sure, I had a look: On On The remaining issues listed in my first post also apply to these branches.
Alright, will do. I just realized using |
Since djgpp has neither a timezone variable or timegm(), this horrible method must be used. It is the only one I could find that produces accurate results, and is recommended as portable alternative to timegm() by the GNU libc manual. Reference: https://www.gnu.org/software/libc/manual/html_node/Broken_002ddown-Time.html#index-timegm Now, a much nicer alternative solution could be: timestamp_local = mktime(timestamp_tm); timestamp_utc = timestamp_local + timestamp_tm->tm_gmtoff - (timestamp_tm->tm_isdst ? 3600 : 0); This works due to the fact that mktime() populates the tm_gmtoff and tm_isdst fields in the source timestamp. It is accurate everywhere in the world, *except* on Lord Howe Island, Australia, where a 30 minute DST offset is used.
CLA is signed, so this PR is ready for review. I was told I had to close and |
Another question - would it be useful to add djgpp as a CI build target? I If there is any interest, and there are no objections to adding a dependency on |
24 hours has passed since 'approval: done' was set, but as this PR has been updated in that time the label 'approval: ready to merge' is not being automatically set. Please review the updates and set the label manually. |
Build failed on djgpp due to missing config vars 'AR' and 'ARFLAGS'. Additionally, '-lz' was not added to 'lflags' when zlib support was enabled. Inheriting configuration variables from BASE_unix solves both these issues. CLA: trivial Reviewed-by: Richard Levitte <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from #19274)
This part failed to compile due to a circular dependency between internal/e_os.h and internal/time.h, when ossl_sleep() falls back to a busy wait. However, djgpp has a usleep function, so it can use the regular Unix version of ossl_sleep(). It's not great though. The resolution is only ~55ms, and it may break when a user program hooks the timer interrupt without periodically updating BIOS time. A high-resolution alternative is uclock(), but that is generally less desirable since it reprograms the system timer. The circular dependency is still there and may still cause trouble for other platforms. CLA: trivial Reviewed-by: Richard Levitte <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from #19274)
If this macro is left undefined, Watt-32 will "helpfully" declare some typedefs such as 'byte' and 'word' in the global namespace. This broke compilation of apps/s_client.c. CLA: trivial Reviewed-by: Richard Levitte <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from #19274)
Since djgpp has neither a timezone variable or timegm(), this horrible method must be used. It is the only one I could find that produces accurate results, and is recommended as portable alternative to timegm() by the GNU libc manual. Reference: https://www.gnu.org/software/libc/manual/html_node/Broken_002ddown-Time.html#index-timegm Now, a much nicer alternative solution could be: timestamp_local = mktime(timestamp_tm); timestamp_utc = timestamp_local + timestamp_tm->tm_gmtoff - (timestamp_tm->tm_isdst ? 3600 : 0); This works due to the fact that mktime() populates the tm_gmtoff and tm_isdst fields in the source timestamp. It is accurate everywhere in the world, *except* on Lord Howe Island, Australia, where a 30 minute DST offset is used. Reviewed-by: Richard Levitte <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from #19274)
Build failed on djgpp due to missing config vars 'AR' and 'ARFLAGS'. Additionally, '-lz' was not added to 'lflags' when zlib support was enabled. Inheriting configuration variables from BASE_unix solves both these issues. CLA: trivial Reviewed-by: Richard Levitte <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from #19274) (cherry picked from commit 29d82bd)
This part failed to compile due to a circular dependency between internal/e_os.h and internal/time.h, when ossl_sleep() falls back to a busy wait. However, djgpp has a usleep function, so it can use the regular Unix version of ossl_sleep(). It's not great though. The resolution is only ~55ms, and it may break when a user program hooks the timer interrupt without periodically updating BIOS time. A high-resolution alternative is uclock(), but that is generally less desirable since it reprograms the system timer. The circular dependency is still there and may still cause trouble for other platforms. CLA: trivial Reviewed-by: Richard Levitte <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from #19274) (cherry picked from commit 6512559)
If this macro is left undefined, Watt-32 will "helpfully" declare some typedefs such as 'byte' and 'word' in the global namespace. This broke compilation of apps/s_client.c. CLA: trivial Reviewed-by: Richard Levitte <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from #19274) (cherry picked from commit 8ae74c5)
Merged to master branch. Cherry-picked to 3.0 branch except for the last commit which does not apply there. Closing.
I am not sure about that. You can submit a PR if you want but this is something we would need to discuss within OTC IMO before merging it. |
Thanks for merging! I see now
That is understandable. I'll submit the PR then and see what happens. |
Build failed on djgpp due to missing config vars 'AR' and 'ARFLAGS'. Additionally, '-lz' was not added to 'lflags' when zlib support was enabled. Inheriting configuration variables from BASE_unix solves both these issues. CLA: trivial Reviewed-by: Richard Levitte <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from openssl#19274)
This part failed to compile due to a circular dependency between internal/e_os.h and internal/time.h, when ossl_sleep() falls back to a busy wait. However, djgpp has a usleep function, so it can use the regular Unix version of ossl_sleep(). It's not great though. The resolution is only ~55ms, and it may break when a user program hooks the timer interrupt without periodically updating BIOS time. A high-resolution alternative is uclock(), but that is generally less desirable since it reprograms the system timer. The circular dependency is still there and may still cause trouble for other platforms. CLA: trivial Reviewed-by: Richard Levitte <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from openssl#19274)
If this macro is left undefined, Watt-32 will "helpfully" declare some typedefs such as 'byte' and 'word' in the global namespace. This broke compilation of apps/s_client.c. CLA: trivial Reviewed-by: Richard Levitte <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from openssl#19274)
Since djgpp has neither a timezone variable or timegm(), this horrible method must be used. It is the only one I could find that produces accurate results, and is recommended as portable alternative to timegm() by the GNU libc manual. Reference: https://www.gnu.org/software/libc/manual/html_node/Broken_002ddown-Time.html#index-timegm Now, a much nicer alternative solution could be: timestamp_local = mktime(timestamp_tm); timestamp_utc = timestamp_local + timestamp_tm->tm_gmtoff - (timestamp_tm->tm_isdst ? 3600 : 0); This works due to the fact that mktime() populates the tm_gmtoff and tm_isdst fields in the source timestamp. It is accurate everywhere in the world, *except* on Lord Howe Island, Australia, where a 30 minute DST offset is used. Reviewed-by: Richard Levitte <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from openssl#19274)
I tried cross-compiling the current
master
branch for djgpp and ran into someerrors. This patch set aims to solve those.
On each commit I specified
CLA: trivial
, since they are small tweaks and donot introduce any new features. Only build errors are fixed.
Remaining issues:
test/rsa_complex.c
does not compile due to missing header<complex.h>
.-march=i486
or better, due tomissing atomic instructions on i386 (these are compiled to libatomic calls,
which are also missing). Is it safe to define
-DOPENSSL_DEV_NO_ATOMICS
here, given that we have no (native) pre-emptive threads?