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

Native build fails #487

Closed
christianrauch opened this issue Sep 30, 2018 · 5 comments
Closed

Native build fails #487

christianrauch opened this issue Sep 30, 2018 · 5 comments

Comments

@christianrauch
Copy link

I am trying to build the userland native on x86_64 via ./buildme --native.

The build fails with error: size of array ‘vcos_static_assert’ is negative messages:

[...]/userland/build/inc/interface/vcos/vcos_assert.h:303:69: error: size of array ‘vcos_static_assert’ is negative
 #define vcos_static_assert(cond) __attribute__((unused)) extern int vcos_static_assert[(cond)?1:-1]
                                                                     ^
[...]/userland/interface/khronos/common/khrn_client_check_types.h:44:1: note: in expansion of macro ‘vcos_static_assert’
 vcos_static_assert(sizeof(EGLConfig) == 4);
 ^~~~~~~~~~~~~~~~~~
[...]/userland/build/inc/interface/vcos/vcos_assert.h:303:69: error: size of array ‘vcos_static_assert’ is negative
 #define vcos_static_assert(cond) __attribute__((unused)) extern int vcos_static_assert[(cond)?1:-1]
                                                                     ^
[...]/userland/interface/khronos/common/khrn_client_check_types.h:45:1: note: in expansion of macro ‘vcos_static_assert’
 vcos_static_assert(sizeof(EGLContext) == 4);
 ^~~~~~~~~~~~~~~~~~
[...]/userland/build/inc/interface/vcos/vcos_assert.h:303:69: error: size of array ‘vcos_static_assert’ is negative
 #define vcos_static_assert(cond) __attribute__((unused)) extern int vcos_static_assert[(cond)?1:-1]
                                                                     ^
[...]/userland/interface/khronos/common/khrn_client_check_types.h:46:1: note: in expansion of macro ‘vcos_static_assert’
 vcos_static_assert(sizeof(EGLDisplay) == 4);
 ^~~~~~~~~~~~~~~~~~
[...]/userland/build/inc/interface/vcos/vcos_assert.h:303:69: error: size of array ‘vcos_static_assert’ is negative
 #define vcos_static_assert(cond) __attribute__((unused)) extern int vcos_static_assert[(cond)?1:-1]
                                                                     ^
[...]/userland/interface/khronos/common/khrn_client_check_types.h:47:1: note: in expansion of macro ‘vcos_static_assert’
 vcos_static_assert(sizeof(EGLSurface) == 4);
 ^~~~~~~~~~~~~~~~~~
[...]/userland/build/inc/interface/vcos/vcos_assert.h:303:69: error: size of array ‘vcos_static_assert’ is negative
 #define vcos_static_assert(cond) __attribute__((unused)) extern int vcos_static_assert[(cond)?1:-1]
                                                                     ^
[...]/userland/interface/khronos/common/khrn_client_check_types.h:48:1: note: in expansion of macro ‘vcos_static_assert’
 vcos_static_assert(sizeof(EGLClientBuffer) == 4);
 ^~~~~~~~~~~~~~~~~~
[...]/userland/build/inc/interface/vcos/vcos_assert.h:303:69: error: size of array ‘vcos_static_assert’ is negative
 #define vcos_static_assert(cond) __attribute__((unused)) extern int vcos_static_assert[(cond)?1:-1]
                                                                     ^
[...]/userland/interface/khronos/common/khrn_client_check_types.h:49:1: note: in expansion of macro ‘vcos_static_assert’
 vcos_static_assert(sizeof(NativeDisplayType) == 4);
 ^~~~~~~~~~~~~~~~~~
[...]/userland/build/inc/interface/vcos/vcos_assert.h:303:69: error: size of array ‘vcos_static_assert’ is negative
 #define vcos_static_assert(cond) __attribute__((unused)) extern int vcos_static_assert[(cond)?1:-1]
                                                                     ^
[...]/userland/interface/khronos/common/khrn_client_check_types.h:50:1: note: in expansion of macro ‘vcos_static_assert’
 vcos_static_assert(sizeof(NativePixmapType) == 4);
 ^~~~~~~~~~~~~~~~~~
[...]/userland/build/inc/interface/vcos/vcos_assert.h:303:69: error: size of array ‘vcos_static_assert’ is negative
 #define vcos_static_assert(cond) __attribute__((unused)) extern int vcos_static_assert[(cond)?1:-1]
                                                                     ^
[...]/userland/interface/khronos/common/khrn_client_check_types.h:51:1: note: in expansion of macro ‘vcos_static_assert’
 vcos_static_assert(sizeof(NativeWindowType) == 4);
 ^~~~~~~~~~~~~~~~~~
[...]/userland/build/inc/interface/vcos/vcos_assert.h:303:69: error: size of array ‘vcos_static_assert’ is negative
 #define vcos_static_assert(cond) __attribute__((unused)) extern int vcos_static_assert[(cond)?1:-1]
                                                                     ^
[...]/userland/interface/khronos/common/khrn_client_check_types.h:71:1: note: in expansion of macro ‘vcos_static_assert’
 vcos_static_assert(sizeof(GLintptr) == 4);
 ^~~~~~~~~~~~~~~~~~
[...]/userland/build/inc/interface/vcos/vcos_assert.h:303:69: error: size of array ‘vcos_static_assert’ is negative
 #define vcos_static_assert(cond) __attribute__((unused)) extern int vcos_static_assert[(cond)?1:-1]
                                                                     ^
[...]/userland/interface/khronos/common/khrn_client_check_types.h:72:1: note: in expansion of macro ‘vcos_static_assert’
 vcos_static_assert(sizeof(GLsizeiptr) == 4);

@pelwell
Copy link
Contributor

pelwell commented Sep 30, 2018

This behaviour is by design.

Although the errors are slightly ugly, the vcos_static_assertmacro is working as expected. If you look at the note: in expansion lines you'll see that all of the expressions evaluate to false on your 64-bit platform; the userland repo is not designed to be built on a platform where integers are 64 bits wide, and these static assertions ensure that doesn't happen.

@pelwell pelwell closed this as completed Sep 30, 2018
@christianrauch
Copy link
Author

I tried to build in an x86 virtual machine but got linking errors against arm libraries.
Is it actually possible to build natively on anything other than arm?

@pelwell
Copy link
Contributor

pelwell commented Sep 30, 2018

Some elements can be built natively for 64-bit - the dtoverlay command, for example - but no effort has been made to make the repo cross-platform.

@6by9
Copy link
Contributor

6by9 commented Sep 30, 2018

Which elements are you expecting to be useful on other platforms?

Most of the stuff in the host_applications directory is connecting to GPU based resources which won't exist on any other platform.
Interface is the IPCs.
Containers should build, but you're probably better off using libavformat.
helpers is dtoverlay and some headers.
The rest is pretty much supporting headers .

@christianrauch
Copy link
Author

I basically tried to build it as part of a larger piece of software. I wanted to avoid setting up cross-compiling for the whole project.
I am aware that the userland software is not useful for any other target and that it can indeed be cross-compiled. But if you want to develop software (on an x86 desktop) that is using userland components, you would need to setup cross-compiling for the whole project which is usually not straight forward.

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

No branches or pull requests

3 participants