Skip to content

Build H2 with Picolibc#10

Open
quic-k wants to merge 1 commit into
masterfrom
build-with-pico
Open

Build H2 with Picolibc#10
quic-k wants to merge 1 commit into
masterfrom
build-with-pico

Conversation

@quic-k
Copy link
Copy Markdown
Contributor

@quic-k quic-k commented Apr 20, 2026

No description provided.

Signed-off-by: Kushal Pal <kushpal@qti.qualcomm.com>
Copy link
Copy Markdown

@colmode colmode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, but we might want to merge this after erich's makefile changes rather than the other way around.

r1 = #__boot_net_phys_offset__
memw(r1) = r0
jump _start // picolibc CRT entry (replaces hexagon_pre_main)

Copy link
Copy Markdown
Contributor Author

@quic-k quic-k May 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can, but since we are not including any C header, we don't have __PICOLIBC__
so for simplicity I created 2 files

maybe I will have to use the PICOLIBC=1 flag to define a macro, which we can use
or do you have something else in mind?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"PICOLIBC=1 flag to define a macro", yes. But since this is all transitional and we'll eventually use only pico I think that leaving it as is would be fine.

r1 = #__boot_net_phys_offset__
memw(r1) = r0
jump _start // picolibc CRT entry (replaces hexagon_pre_main)

Copy link
Copy Markdown
Contributor Author

@quic-k quic-k May 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can, but since we are not including any C header, we don't have __PICOLIBC__
so for simplicity I created 2 files

maybe I will have to use the PICOLIBC=1 flag to define a macro, which we can use
or do you have something else in mind?

@quic-k
Copy link
Copy Markdown
Contributor Author

quic-k commented May 5, 2026

Looks good overall, but we might want to merge this after erich's makefile changes rather than the other way around.

thanks for the review, ping me whenever that is merged, I will have to resolve merge conflicts

Also, we don't yet have a way to run unit tests with pico since those tools aren't on github. Best to run make testall locally and then comment here when it passes.

sure, so far I have built H2 successfully and used the install artifacts to run Picolibc testsuite which passes
will look into getting H2 unit tests working with Picolibc

@bryanb-h2
Copy link
Copy Markdown
Contributor

Looks good overall, but we might want to merge this after erich's makefile changes rather than the other way around.

Hey, look; our first comment from a non-qc account :)

@quic-k
Copy link
Copy Markdown
Contributor Author

quic-k commented May 7, 2026

why is hexagon_standalone.h being used? @bryanb-h2

#include <hexagon_standalone.h>

#include <hexagon_standalone.h>

@bryanb-h2
Copy link
Copy Markdown
Contributor

bryanb-h2 commented May 7, 2026

why is hexagon_standalone.h being used? @bryanb-h2

#include <hexagon_standalone.h>

#include <hexagon_standalone.h>

Because most of the unit tests run with standalone with a test harness for testing only one function -- avoids booting the kernel to simplify debug. We need a substitute for standalone but we haven't addressed this yet. The unit tests don't even use features of standalone. Using the default dinkum build is just a convenient way to link with crt0 and get to main(). We actually have a min_crt0 in the h2 repo. Just need to dust that off and change how we link unit tests.

Here it is, entirely:

/*

  • Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.

  • SPDX-License-Identifier: BSD-3-Clause-Clear
    */

    .section .start,"awx",@progbits

.global _start

.global hexagon_pre_main

#_start:

jump start

hexagon_pre_main:
r0 = ##SDA_BASE
gp = r0
r29 = ##stack
{
r0 = r29
r1 = #1
call main
}

jump start

.data
.p2align 8
.space 1024

stack:
.word stack
.word 0

@quic-k
Copy link
Copy Markdown
Contributor Author

quic-k commented May 7, 2026

Because most of the unit tests run with standalone with a test harness for testing only one function -- avoids booting the kernel to simplify debug.

yeah, for debugging that is better, but booter tests would have been easier for me to get passing

We need a substitute for standalone but we haven't addressed this yet. The unit tests don't even use features of standalone. Using the default dinkum build is just a convenient way to link with crt0 and get to main(). We actually have a min_crt0 in the h2 repo. Just need to dust that off and change how we link unit tests.

is this planned to be done soon? or am I supposed to do this in this PR? maybe I could but this sounds like lot of debugging
:\

@bryanb-h2
Copy link
Copy Markdown
Contributor

Because most of the unit tests run with standalone with a test harness for testing only one function -- avoids booting the kernel to simplify debug.

yeah, for debugging that is better, but booter tests would have been easier for me to get passing

We need a substitute for standalone but we haven't addressed this yet. The unit tests don't even use features of standalone. Using the default dinkum build is just a convenient way to link with crt0 and get to main(). We actually have a min_crt0 in the h2 repo. Just need to dust that off and change how we link unit tests.

is this planned to be done soon? or am I supposed to do this in this PR? maybe I could but this sounds like lot of debugging :\

Not unless you're really keen to do it. I just filed QDSP-57392 for this.

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.

3 participants