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

Compile Limitation: OSSL_TIME, uint64_t #15

Open
rsbeckerca opened this issue Sep 19, 2024 · 3 comments
Open

Compile Limitation: OSSL_TIME, uint64_t #15

rsbeckerca opened this issue Sep 19, 2024 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@rsbeckerca
Copy link

This is on HPE NonStop x86

The OSSL_TIME definition is not available in a post-install OpenSSL instance. It appears that this only works when referencing a built instance from source. Is that the intent?

Also, on some platforms, uint64_t is not defined by the compiler but needs stdint.h.

Also, having some other options, like CPPFLAGS is not inheriting from the command line, -pthread is a non-portable option.

@nhorman
Copy link
Contributor

nhorman commented Sep 20, 2024

regarding OSSL_TIME
The definition is in internal/time.h , so my assumption is that OSSL_TIME, and in fact the entire time api (as defined in internal/time.h) is not exported and available. In fact, even if you are referencing them from a source tree directly, any application built that way would have to include "internal/time.h", which would be incorrect, and should result in a failed link, as symbols like ossl_time2us, etc would fail when doing a final link when building with shared libraries. It would likely work by happenstance when building against the static library, since there is no control there over symbol export, but as a rule, applications should not be able to use that API.

regarding uint64_t
What you're saying makes sense, but I'm not sure what issue you're running into here. Are you saying that you're building an openssl app that needs to instantiate a uint64_t for which the openssl headers haven't included stdint.h?

regarding CPPFLAGS
I'm not quite sure how to interpret this either. It may well be possible that CPPFLAGS doesn't get inherited in some cases properly, but we would need to see a specific example to investigate further. Additionally, I don't think -pthread is a flag that you should commonly be passing via CPPFLAGS (as those are preprocessor flags). CFLAGS and LDFLAGS are normally where -pthread would get included. Though I may well be missing an understanding of the problem here.

@t8m
Copy link
Member

t8m commented Sep 20, 2024

Please note that perftools do NOT depend on any internal OpenSSL headers - they define OSSL_TIME themselves in the perflib headers.

For the uint64_t issue - this should be simple to fix. We should just include stdint.h from https://github.com/openssl/perftools/blob/main/source/perflib/time.h this file.

@t8m
Copy link
Member

t8m commented Sep 20, 2024

Also the portability of perftools is not expected to be as broad as of the openssl library itself as the primary goal was to make it buildable on the primary platforms, not everything that openssl library supports. However of course we would accept patches that fix any portability issues if they are reasonable.

@t8m t8m added the help wanted Extra attention is needed label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants