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

Implement SIMD checks for FreeBSD/powerpc* #1029

Merged
merged 1 commit into from
Apr 25, 2021
Merged

Implement SIMD checks for FreeBSD/powerpc* #1029

merged 1 commit into from
Apr 25, 2021

Conversation

pkubaj
Copy link
Contributor

@pkubaj pkubaj commented Apr 25, 2021

FreeBSD uses elf_aux_info() instead of getauxval().

FreeBSD uses elf_aux_info() instead of getauxval().
@noloader noloader merged commit 91173a2 into weidai11:master Apr 25, 2021
@noloader
Copy link
Collaborator

Thank you very much.

We are probably missing a few FreeBSD specific checks.

@noloader
Copy link
Collaborator

noloader commented Apr 26, 2021

Thanks again @pkubaj,

It looks like we are catching compile failures on FreeBSD 12 and 13. See https://github.com/noloader/cryptopp/runs/2437036069.

It looks like a FreeBSD bug to me. Including their headers causes the compile failure (https://github.com/weidai11/cryptopp/blob/master/cpu.cpp#L60):

#if defined(__FreeBSD__)
# include <machine/cpu.h>
# include <sys/auxv.h>
# include <sys/elf_common.h>
#endif

I got the header #include <sys/auxv.h> from https://www.freebsd.org/cgi/man.cgi?query=elf_aux_info. I don't recall where the other headers came from.

Would you be able to let the FreeBSD folks know?

In the mean time, I'll guard the includes for PowerPC only.


Here's the output from the compile. Unfortunately, the compile command is missing in the CirrusCI output.

        register_t      tf_r14;
        ^
/usr/include/x86/_types.h:104:19: note: '__register_t' declared here
typedef __int64_t       __register_t;
                        ^
In file included from cpu.cpp:62:
In file included from /usr/include/machine/cpu.h:45:
In file included from /usr/include/machine/frame.h:37:
/usr/include/x86/frame.h:137:2: error: unknown type name 'register_t'; did you mean '__register_t'?
        register_t      tf_r15;
        ^
/usr/include/x86/_types.h:104:19: note: '__register_t' declared here
typedef __int64_t       __register_t;
                        ^
In file included from cpu.cpp:62:
In file included from /usr/include/machine/cpu.h:45:
In file included from /usr/include/machine/frame.h:37:
/usr/include/x86/frame.h:141:2: error: unknown type name 'register_t'; did you mean '__register_t'?
        register_t      tf_addr;
        ^
/usr/include/x86/_types.h:104:19: note: '__register_t' declared here
typedef __int64_t       __register_t;
                        ^
In file included from cpu.cpp:62:
In file included from /usr/include/machine/cpu.h:45:
In file included from /usr/include/machine/frame.h:37:
/usr/include/x86/frame.h:146:2: error: unknown type name 'register_t'; did you mean '__register_t'?
        register_t      tf_err;
        ^
/usr/include/x86/_types.h:104:19: note: '__register_t' declared here
typedef __int64_t       __register_t;
                        ^
In file included from cpu.cpp:62:
In file included from /usr/include/machine/cpu.h:45:
In file included from /usr/include/machine/frame.h:37:
/usr/include/x86/frame.h:147:2: error: unknown type name 'register_t'; did you mean '__register_t'?
        register_t      tf_rip;
        ^
/usr/include/x86/_types.h:104:19: note: '__register_t' declared here
typedef __int64_t       __register_t;
                        ^
In file included from cpu.cpp:62:
In file included from /usr/include/machine/cpu.h:45:
In file included from /usr/include/machine/frame.h:37:
/usr/include/x86/frame.h:148:2: error: unknown type name 'register_t'; did you mean '__register_t'?
        register_t      tf_cs;
        ^
/usr/include/x86/_types.h:104:19: note: '__register_t' declared here
typedef __int64_t       __register_t;
                        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
gmake: *** [GNUmakefile:1767: cpu.o] Error 1
gmake: *** Waiting for unfinished jobs....

Exit status: 2

@noloader
Copy link
Collaborator

noloader commented Apr 26, 2021

I ended up removing the problem hear, which was <machine/cpu.h>. Also see Commit 2619dbec0bfc.

Would you be able to test the change?

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.

None yet

2 participants