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

Alpine ipxe build #25

Open
robvanmieghem opened this issue Mar 14, 2023 · 6 comments
Open

Alpine ipxe build #25

robvanmieghem opened this issue Mar 14, 2023 · 6 comments
Assignees
Labels
type_feature New feature or request

Comments

@robvanmieghem
Copy link

Check if the compiled ipxe works and document the requirements

@robvanmieghem robvanmieghem added the type_feature New feature or request label Mar 14, 2023
@robvanmieghem robvanmieghem self-assigned this Mar 14, 2023
@robvanmieghem robvanmieghem moved this to In Progress in 3.10.x Mar 14, 2023
@robvanmieghem robvanmieghem changed the title Alpine ipxe built Alpine ipxe build Mar 14, 2023
@robvanmieghem
Copy link
Author

robvanmieghem commented Mar 14, 2023

apk add --no-cache bash git make openssl gcc perl coreutils musl-dev xz-dev syslinux xorriso
bash setup/template.sh

It worked on a microvm with Alpine on the grid but in the builders I'm getting this error:

[BUILD] bin/isqrt.o
[-] build: In file included from include/string.h:23,
[-] build:                  from core/gdbudp.c:27:
[-] build: In function '__constant_memcpy',
[-] build:     inlined from 'memcpy' at arch/x86/include/bits/string.h:168:10,
[-] build:     inlined from 'gdbudp_send' at core/gdbudp.c:206:2,
[-] build:     inlined from 'gdbudp_send' at core/gdbudp.c:163:13:
[-] build: arch/x86/include/bits/string.h:94:44: error: array subscript 'const union <anonymous>[0]' is partly outside array bounds of 'uint8_t[6]' {aka 'unsigned char[6]'} [-Werror=array-bounds]
[-] build:    94 |                 dest_u->u32[0] = src_u->u32[0];
[-] build:       |                                  ~~~~~~~~~~^~~
[-] build: core/gdbudp.c: In function 'gdbudp_send':
[-] build: core/gdbudp.c:53:16: note: object 'dest_eth' of size 6
[-] build:    53 | static uint8_t dest_eth[ETH_ALEN];
[-] build:       |                ^~~~~~~~
[-] build: In function '__constant_memcpy',
[-] build:     inlined from 'memcpy' at arch/x86/include/bits/string.h:168:10,
[-] build:     inlined from 'gdbudp_send' at core/gdbudp.c:206:2,
[-] build:     inlined from 'gdbudp_send' at core/gdbudp.c:163:13:
[-] build: arch/x86/include/bits/string.h:95:44: error: array subscript 'const union <anonymous>[0]' is partly outside array bounds of 'uint8_t[6]' {aka 'unsigned char[6]'} [-Werror=array-bounds]
[-] build:    95 |                 dest_u->u16[2] = src_u->u16[2];
[-] build:       |                                  ~~~~~~~~~~^~~
[-] build: core/gdbudp.c: In function 'gdbudp_send':
[-] build: core/gdbudp.c:53:16: note: object 'dest_eth' of size 6
[-] build:    53 | static uint8_t dest_eth[ETH_ALEN];
[-] build:       |                ^~~~~~~~
[-] build: In function '__constant_memcpy',
[-] build:     inlined from 'memcpy' at arch/x86/include/bits/string.h:168:10,
[-] build:     inlined from 'gdbudp_recv' at core/gdbudp.c:137:4:
[-] build: arch/x86/include/bits/string.h:94:32: error: array subscript 'union <anonymous>[0]' is partly outside array bounds of 'uint8_t[6]' {aka 'unsigned char[6]'} [-Werror=array-bounds]
[-] build:    94 |                 dest_u->u32[0] = src_u->u32[0];
[-] build:       |                 ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
[-] build: core/gdbudp.c: In function 'gdbudp_recv':
[-] build: core/gdbudp.c:53:16: note: object 'dest_eth' of size 6
[-] build:    53 | static uint8_t dest_eth[ETH_ALEN];
[-] build:       |                ^~~~~~~~
[-] build: In function '__constant_memcpy',
[-] build:     inlined from 'memcpy' at arch/x86/include/bits/string.h:168:10,
[-] build:     inlined from 'gdbudp_recv' at core/gdbudp.c:137:4:
[-] build: arch/x86/include/bits/string.h:95:32: error: array subscript 'union <anonymous>[0]' is partly outside array bounds of 'uint8_t[6]' {aka 'unsigned char[6]'} [-Werror=array-bounds]
[-] build:    95 |                 dest_u->u16[2] = src_u->u16[2];
[-] build:       |                 ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
[-] build: core/gdbudp.c: In function 'gdbudp_recv':
[-] build: core/gdbudp.c:53:16: note: object 'dest_eth' of size 6
[-] build:    53 | static uint8_t dest_eth[ETH_ALEN];
[-] build:       |                ^~~~~~~~
[+] build:   [BUILD] bin/job.o
[+] build:   [BUILD] bin/linebuf.o
[+] build:   [BUILD] bin/lineconsole.o
[-] build: cc1: all warnings being treated as errors
[-] build: make: *** [Makefile.housekeeping:952: bin/gdbudp.o] Error 1

@maxux
Copy link
Collaborator

maxux commented Mar 15, 2023

Can you give me information ? Alpine version, arch, etc ?

@robvanmieghem
Copy link
Author

robvanmieghem commented Mar 15, 2023

steps to reproduce ( on an ubuntu 22.04 amd64 vm on the grid):

docker run -it --rm alpine:3.17.2 /bin/sh
apk add --no-cache bash git make openssl gcc perl coreutils musl-dev xz-dev syslinux xorriso
wget -cnv https://github.com/threefoldtech/0-bootstrap/archive/refs/tags/v3.0.2.tar.gz  -O /tmp/src.tar.gz
tar --strip-components=1 -xzf /tmp/src.tar.gz -C ./
bash setup/template.sh

The alpine image inspect gives "Architecture": "amd64"

@robvanmieghem
Copy link
Author

robvanmieghem commented Mar 15, 2023

on an alpine microvm on the grid ( Alpine 3.15.0) it does work:

...
[+] ================================================================
[+] ipxe legacy template installed on: /opt/ipxe-template
[+] ipxe uefi template installed on: /opt/ipxe-template-uefi
[+] ================================================================

@robvanmieghem
Copy link
Author

robvanmieghem commented Mar 16, 2023

It also works in an alpine 3.15.0 docker ( on the same ubuntu 22.04 amd64 vm on the grid as used for the alpine:3.17.2)

@maxux
Copy link
Collaborator

maxux commented Mar 17, 2023

Fixed using gcc-12 branch of our iPXE fork.

The problem is related to gcc 12 which is used in the latest alpine. The bug have been fixed in the latest master of upstream https://github.com/ipxe/ipxe. I merged that master into gcc-12 branch of our fork (https://github.com/threefoldtech/ipxe). It compiles.

Now we need to see if that latest version works correctly :)

@maxux maxux moved this from In Progress to Verification in 3.10.x Mar 17, 2023
@robvanmieghem robvanmieghem removed this from 3.10.x Mar 29, 2023
@robvanmieghem robvanmieghem moved this to In Progress in 3.11.x Mar 29, 2023
@robvanmieghem robvanmieghem removed this from 3.11.x Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type_feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants