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

[libc][errno] Remove non asm generic error number #92172

Merged
merged 1 commit into from
May 15, 2024

Conversation

robincaloudis
Copy link
Contributor

@robincaloudis robincaloudis commented May 14, 2024

The following small thing caught my eye:

  1. EILSEQ is not part of the generic asm error number macros. See the full list of generic asm errno codes. AFAIK the generic asm errno numbers are common between different operating systems and architectures. EILSEQ is not part of this common set of errno's.

  2. EILSEQ's value is wrong. During the addition of EILSEQ in https://reviews.llvm.org/D151129, the value 35 was probably chosen as its the consecutive number. This is not correct. The actual values can be looked up for example here:

@robincaloudis robincaloudis changed the title [libc][errno] Remove non asm generic errno [libc][errno] Fix wrong asm generic error number May 14, 2024
@robincaloudis robincaloudis changed the title [libc][errno] Fix wrong asm generic error number [libc][errno] Remove non asm generic error number May 14, 2024
@robincaloudis robincaloudis marked this pull request as ready for review May 14, 2024 21:24
@llvmbot llvmbot added the libc label May 14, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented May 14, 2024

@llvm/pr-subscribers-libc

Author: Robin Caloudis (robincaloudis)

Changes

The following small thing caught my eye:

  1. EILSEQ is not part of the generic asm error number macros. See the full list of generic asm errno codes. AFAIK the generic asm errno numbers are common between different operating systems and architectures. EILSEQ is not part of this common set of errno's.

  2. EILSEQ's value is wrong. During the addition of EILSEQ in https://reviews.llvm.org/D151129, the value 35 was probably chosen as its the consecutive number. This is not correct. The actual values can be looked up for example here:


Full diff: https://github.com/llvm/llvm-project/pull/92172.diff

1 Files Affected:

  • (modified) libc/include/llvm-libc-macros/generic-error-number-macros.h (-1)
diff --git a/libc/include/llvm-libc-macros/generic-error-number-macros.h b/libc/include/llvm-libc-macros/generic-error-number-macros.h
index b5b1b676dacc3..cb4411fbac665 100644
--- a/libc/include/llvm-libc-macros/generic-error-number-macros.h
+++ b/libc/include/llvm-libc-macros/generic-error-number-macros.h
@@ -43,7 +43,6 @@
 #define EPIPE 32
 #define EDOM 33
 #define ERANGE 34
-#define EILSEQ 35
 #define ENAMETOOLONG 36
 #define EOVERFLOW 75
 

Copy link
Contributor

@michaelrj-google michaelrj-google left a comment

Choose a reason for hiding this comment

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

Thanks for catching this!

@robincaloudis
Copy link
Contributor Author

You are welcome. Do you mind merging this PR? I still lack write access.

@lntue lntue merged commit a71e2b9 into llvm:main May 15, 2024
8 checks passed
@jplehr
Copy link
Contributor

jplehr commented May 15, 2024

Hi,
I think this broke the AMDGPU libc buildbot: https://lab.llvm.org/buildbot/#/builders/259/builds/4468
I'll see if I can fix it.

@robincaloudis
Copy link
Contributor Author

Thanks for pointing out! Yes, it did. I realised it too. Didn't manage to fix it in the morning. I will look into it around 6pm (UTC+1). You are more than welcome to go ahead if you have an idea on how to fix the build. Thanks!

jplehr added a commit to jplehr/llvm-project that referenced this pull request May 15, 2024
This fixes a build error on the AMDGPU buildbot introduced in PR
llvm#92172
jhuber6 pushed a commit that referenced this pull request May 15, 2024
This fixes a build error on the AMDGPU buildbot introduced in PR
#92172
mub-at-arm pushed a commit to mub-at-arm/llvm-project that referenced this pull request May 16, 2024
The following small thing caught my eye:

1) `EILSEQ` is not part of the generic asm error number macros. See the
[full list of generic asm errno
codes](https://github.com/torvalds/linux/blob/4b95dc87362aa57bdd0dcbad109ca5e5ef3cbb6c/include/uapi/asm-generic/errno-base.h).
AFAIK the generic asm errno numbers are common between different
operating systems and architectures. `EILSEQ` is not part of this common
set of errno's.

2) `EILSEQ`'s value is wrong. During the addition of `EILSEQ` in
https://reviews.llvm.org/D151129, the value `35` was probably chosen as
its the consecutive number. This is not correct. The actual values can
be looked up for example here:
* [For Linux
kernel](https://github.com/search?q=repo%3Atorvalds%2Flinux+EILSEQ&type=code&p=1):
`EILSEQ = 84` (uapi; i.e. x86_64), `EILSEQ = 88` (mips), `EILSEQ = 47`
(parisc)
* [For Darwin
kernel](https://github.com/apple-oss-distributions/xnu/blob/main/bsd/sys/errno.h#L237):
`EILSEQ = 92`
mub-at-arm pushed a commit to mub-at-arm/llvm-project that referenced this pull request May 16, 2024
This fixes a build error on the AMDGPU buildbot introduced in PR
llvm#92172
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants