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

Add -Wall -Werror for enclave code & fix issues #377

Merged
merged 14 commits into from Jun 11, 2020

Conversation

letmaik
Copy link
Contributor

@letmaik letmaik commented Jun 3, 2020

-Wall -Werror was only used for host-side code.

@letmaik letmaik requested review from davidchisnall and prp June 3, 2020 17:30
@SeanTAllen
Copy link
Contributor

I love this PR!

Copy link
Member

@prp prp left a comment

Choose a reason for hiding this comment

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

Good stuff. @davidchisnall should also review.

src/host_interface/virtio_netdev.c Show resolved Hide resolved
src/include/enclave/lthread.h Show resolved Hide resolved
src/main-oe/sgxlkl_run_oe.c Show resolved Hide resolved
@@ -1,6 +1,8 @@
#ifndef _LKL_SYSCALL_OVERRIDES_FUTEX_H
#define _LKL_SYSCALL_OVERRIDES_FUTEX_H

#include <time.h>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is the wrong include, we need the LKL types, not any system ones. They may be the same, but only by coincidence.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ideally yes, but other pieces pull in musl headers as well and if I make a change here then we'll get redefinition errors. Concretely, musl's pthread.h (included by enclave_oe.c) includes bits/alltypes.h which defines timespec. I'll leave it as it is, I'm sure this won't be an issue anymore after relayering.

Copy link
Contributor

Choose a reason for hiding this comment

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

Really? This file should be included in only two places and neither of them should include musl.

That said, this file is actually dead code, so a simpler fix is to delete it and the #includes of it...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This requires a change in sgx-lkl-musl (src/internal/syscall.h) which is currently at 393a467 but the futex syscall bypass removal is a few commits later. Very confusing... Should I create a PR against sgx-lkl-musl's oe_port and then bump the submodule to the newest commit?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes please. I thought we'd bumped the musl version when we merged the change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lsds/sgx-lkl-musl#19. I bumped sgx-lkl-musl to the PR commit. If CI passes here, we can merge the sgx-lkl-musl PR and then bump to the merged commit in oe_port (which may or may not be the same).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is failing left and right... I have a feeling it's due to the sgx-lkl-musl bump. I'll open a PR with just the bump and get that merged first (or not, if it exposes the same issues).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I opened #410 but I realized that this is already being done in another PR. Probably that's the one you were thinking of, it's not merged yet. I will have to wait for that first.

Copy link
Contributor

Choose a reason for hiding this comment

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

We should undo the fstat byassing in sgx-lkl-musl. We merged the PR for sgx-lkl-musl, but not the corresponding PR to sgx-lkl. So if you bump sgx-lkl-msul, the orphen change will be included.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I scheduled another build for #381. Not sure what was/is wrong with CI. If this passes I would go ahead and merge #381.

src/lkl/disk_mem.c Outdated Show resolved Hide resolved
src/lkl/posix-host.c Outdated Show resolved Hide resolved
src/lkl/setup.c Outdated Show resolved Hide resolved
@letmaik letmaik marked this pull request as draft June 9, 2020 15:08
@letmaik letmaik marked this pull request as ready for review June 11, 2020 08:03
@letmaik letmaik merged commit 4547df1 into oe_port Jun 11, 2020
@letmaik letmaik deleted the letmaik/warnings-as-errors branch June 11, 2020 08:48
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

5 participants