Commit 00e822b5 authored by Palmer Dabbelt's avatar Palmer Dabbelt
Browse files

Merge branch 'to_archive' into __archive__

parents fd3cb638 89f4e3ab
autom4te.cache
build
config.log
config.status
Makefile
.DS_Store
[submodule "riscv-binutils-gdb"]
path = riscv-binutils-gdb
url = ../riscv-binutils-gdb.git
[submodule "riscv-gcc"]
path = riscv-gcc
url = ../riscv-gcc.git
[submodule "riscv-glibc"]
path = riscv-glibc
url = ../riscv-glibc.git
[submodule "riscv-dejagnu"]
path = riscv-dejagnu
url = ../riscv-dejagnu.git
[submodule "riscv-newlib"]
path = riscv-newlib
url = ../riscv-newlib.git
addons:
apt:
packages:
- autoconf
- automake
- autotools-dev
- bc
- bison
- build-essential
- curl
- flex
- gawk
- gperf
- libgmp-dev
- libmpc-dev
- libmpfr-dev
- libtool
- patchutils
- texinfo
before_install:
- export MAKEFLAGS="-j3"
install: true
script:
- ./configure --prefix=/tmp/build-default
- (make > /dev/null) || (make -j1 && exit 1)
This diff is collapsed.
srcdir := @abs_top_srcdir@
builddir := @abs_top_builddir@
INSTALL_DIR := @prefix@
PACKAGES :=
DISTDIR ?= /var/cache/distfiles
GNU_MIRROR := http://mirrors.kernel.org/gnu
gcc_url := $(GNU_MIRROR)/gcc/gcc-$(gcc_version)/gcc-$(gcc_version).tar.gz
glibc_url := $(GNU_MIRROR)/glibc/glibc-$(glibc_version).tar.gz
newlib_url := ftp://sourceware.org/pub/newlib/newlib-$(newlib_version).tar.gz
WITH_ARCH ?= @WITH_ARCH@
WITH_ABI ?= @WITH_ABI@
SYSROOT := $(INSTALL_DIR)/sysroot
SHELL := /bin/sh
AWK := @GAWK@
SED := @GSED@
PATH := $(INSTALL_DIR)/bin:$(PATH)
# Check to see if we need wrapper scripts for awk/sed (which point to
# gawk/gsed on platforms where these aren't the default), otherwise
# don't override these as the wrappers don't always work.
ifneq (@GSED@,/bin/sed)
PATH := $(base_dir)/sed:$(PATH)
endif
ifneq (@GAWK@,/usr/bin/gawk)
PATH := $(base_dir)/awk:$(PATH)
endif
export PATH AWK SED
MULTILIB_FLAGS := @multilib_flags@
MULTILIB_NAMES := @multilib_names@
GCC_CHECKING_FLAGS := @gcc_checking@
XLEN := $(shell echo $(WITH_ARCH) | tr A-Z a-z | sed 's/.*rv\([0-9]*\).*/\1/')
ifneq ($(XLEN),32)
XLEN := 64
endif
ifeq ($(MULTILIB_NAMES),)
MULTILIB_NAMES := $(subst --with-arch=,,$(WITH_ARCH))-$(subst --with-abi=,,$(WITH_ABI))
endif
CFLAGS_FOR_TARGET := $(CFLAGS_FOR_TARGET_EXTRA)
ASFLAGS_FOR_TARGET := $(ASFLAGS_FOR_TARGET_EXTRA)
GLIBC_TARGET_FLAGS := $(GLIBC_TARGET_FLAGS_EXTRA)
GLIBC_CC_FOR_TARGET ?= riscv$(XLEN)-unknown-linux-gnu-gcc
GLIBC_CXX_FOR_TARGET ?= riscv$(XLEN)-unknown-linux-gnu-g++
all: @default_target@
newlib: stamps/build-gcc-newlib
linux: stamps/build-gcc-linux-stage2
$(addprefix src/original-,$(PACKAGES)):
mkdir -p src
rm -rf $@ $(subst original-,,$@)-*
cd src && (cat $(DISTDIR)/$(subst src/original-,,$@)-$($(subst src/original-,,$@)_version).tar.gz || @FETCHER@ $($(subst src/original-,,$@)_url)) | tar zxf -
mv $(subst original-,,$@)-$($(subst src/original-,,$@)_version) $@
$(addprefix src/,$(PACKAGES)): src/%: src/original-%
rm -rf $@ $@.tmp
cp -a $< $@.tmp
$(srcdir)/scripts/cp_s $(srcdir)/$(notdir $@) $@.tmp
cd $@.tmp && patch -p1 < $(srcdir)/patches/$(notdir $@)
if test -f $@.tmp/contrib/download_prerequisites && test "@NEED_GCC_EXTERNAL_LIBRARIES@" == "true"; then cd $@.tmp && ./contrib/download_prerequisites; fi
mv $@.tmp $@
.PHONY: patches $(addprefix $(srcdir)/patches/,$(PACKAGES))
$(addprefix $(srcdir)/patches/,$(PACKAGES)): $(srcdir)/patches/%: src/%
-cd src/$(notdir $@) && rm `cd $(srcdir)/$(notdir $@) && find . -type f`
-cd src && diff --exclude=manual --exclude=autom4te.cache -rupN original-$(notdir $@) $(notdir $@) | filterdiff --remove-timestamps > $@
$(srcdir)/scripts/cp_s $(srcdir)/$(notdir $@) $<
patches: $(addprefix $(srcdir)/patches/,$(PACKAGES))
stamps/build-binutils-linux: $(srcdir)/riscv-binutils-gdb
rm -rf $@ $(notdir $@)
mkdir $(notdir $@)
cd $(notdir $@) && $</configure \
--target=riscv$(XLEN)-unknown-linux-gnu \
--prefix=$(INSTALL_DIR) \
--with-sysroot=$(SYSROOT) \
$(MULTILIB_FLAGS) \
--disable-werror \
--disable-nls
$(MAKE) -C $(notdir $@)
$(MAKE) -C $(notdir $@) install
mkdir -p $(dir $@) && touch $@
stamps/build-linux-headers:
mkdir -p $(SYSROOT)/usr/
cp -a $(srcdir)/linux-headers/include $(SYSROOT)/usr/
mkdir -p $(dir $@) && touch $@
stamps/build-glibc-linux-headers: $(srcdir)/riscv-glibc stamps/build-gcc-linux-stage1
rm -rf $@ $(notdir $@)
mkdir $(notdir $@)
cd $(notdir $@) && CC="$(GLIBC_CC_FOR_TARGET)" $</configure \
--host=riscv$(XLEN)-unknown-linux-gnu \
--prefix=$(SYSROOT)/usr \
libc_cv_forced_unwind=yes \
libc_cv_c_cleanup=yes \
--enable-shared \
--enable-__thread \
--disable-multilib \
--enable-kernel=2.6.32
$(MAKE) -C $(notdir $@) install-headers
mkdir -p $(dir $@) && touch $@
stamps/build-glibc-linux-%: $(srcdir)/riscv-glibc stamps/build-gcc-linux-stage1
rm -rf $@ $(notdir $@)
mkdir $(notdir $@)
cd $(notdir $@) && \
CC="$(GLIBC_CC_FOR_TARGET) -march=$(word 4,$(subst -, ,$@)) -mabi=$(word 5,$(subst -, ,$@))" \
CFLAGS="$(CFLAGS_FOR_TARGET) -g -O2 -march=$(word 4,$(subst -, ,$@)) -mabi=$(word 5,$(subst -, ,$@))" \
ASFLAGS="$(ASFLAGS_FOR_TARGET) -march=$(word 4,$(subst -, ,$@)) -mabi=$(word 5,$(subst -, ,$@))" \
$</configure \
--host=riscv$(XLEN)-unknown-linux-gnu \
--prefix=/usr \
libc_cv_forced_unwind=yes \
libc_cv_c_cleanup=yes \
--disable-werror \
--enable-shared \
--enable-__thread \
$(MULTILIB_FLAGS) \
--enable-kernel=2.6.32 \
$(GLIBC_TARGET_FLAGS) \
$(if $(filter %d,$@),,--without-fp) \
--libdir=/usr/lib$(shell echo $(word 4,$(subst -, ,$@)) | sed 's/.*rv\([0-9]*\).*/\1/')/$(word 5,$(subst -, ,$@)) \
libc_cv_slibdir=/lib$(shell echo $(word 4,$(subst -, ,$@)) | sed 's/.*rv\([0-9]*\).*/\1/')/$(word 5,$(subst -, ,$@))
$(MAKE) -C $(notdir $@)
+flock $(SYSROOT)/.lock $(MAKE) -C $(notdir $@) install install_root=$(SYSROOT)
mkdir -p $(dir $@) && touch $@
stamps/build-gcc-linux-stage1: $(srcdir)/riscv-gcc stamps/build-binutils-linux \
stamps/build-linux-headers
rm -rf $@ $(notdir $@)
mkdir $(notdir $@)
cd $(notdir $@) && $</configure \
--target=riscv$(XLEN)-unknown-linux-gnu \
--prefix=$(INSTALL_DIR) \
--with-sysroot=$(SYSROOT) \
--with-newlib \
--without-headers \
--disable-shared \
--disable-threads \
--with-system-zlib \
--enable-tls \
--enable-languages=c \
--disable-libatomic \
--disable-libmudflap \
--disable-libssp \
--disable-libquadmath \
--disable-libgomp \
--disable-nls \
--disable-bootstrap \
$(GCC_CHECKING_FLAGS) \
$(MULTILIB_FLAGS) \
$(WITH_ABI) \
$(WITH_ARCH)
$(MAKE) -C $(notdir $@) inhibit-libc=true all-gcc
$(MAKE) -C $(notdir $@) inhibit-libc=true install-gcc
$(MAKE) -C $(notdir $@) inhibit-libc=true all-target-libgcc
$(MAKE) -C $(notdir $@) inhibit-libc=true install-target-libgcc
mkdir -p $(dir $@) && touch $@
stamps/build-gcc-linux-stage2: $(srcdir)/riscv-gcc $(addprefix stamps/build-glibc-linux-,$(MULTILIB_NAMES)) \
stamps/build-glibc-linux-headers
rm -rf $@ $(notdir $@)
mkdir $(notdir $@)
cd $(notdir $@) && $</configure \
--target=riscv$(XLEN)-unknown-linux-gnu \
--prefix=$(INSTALL_DIR) \
--with-sysroot=$(SYSROOT) \
--with-system-zlib \
--enable-shared \
--enable-tls \
--enable-languages=c,c++,fortran \
--disable-libmudflap \
--disable-libssp \
--disable-libquadmath \
--disable-nls \
--disable-bootstrap \
$(GCC_CHECKING_FLAGS) \
$(MULTILIB_FLAGS) \
$(WITH_ABI) \
$(WITH_ARCH)
$(MAKE) -C $(notdir $@)
$(MAKE) -C $(notdir $@) install
cp -a $(INSTALL_DIR)/riscv$(XLEN)-unknown-linux-gnu/lib* $(SYSROOT)
mkdir -p $(dir $@) && touch $@
stamps/build-binutils-newlib: $(srcdir)/riscv-binutils-gdb
rm -rf $@ $(notdir $@)
mkdir $(notdir $@)
cd $(notdir $@) && $</configure \
--target=riscv$(XLEN)-unknown-elf \
--prefix=$(INSTALL_DIR) \
--disable-tls \
--disable-werror
$(MAKE) -C $(notdir $@)
$(MAKE) -C $(notdir $@) install
mkdir -p $(dir $@) && touch $@
src/newlib-gcc: $(srcdir)/riscv-gcc
rm -rf $@ $@.tmp
mkdir -p $(dir $@)
cp -a $< $@.tmp
cp -a $(srcdir)/riscv-newlib/newlib $@.tmp
cp -a $(srcdir)/riscv-newlib/libgloss $@.tmp
$(srcdir)/scripts/cp_s $(srcdir)/riscv-newlib $@.tmp
mv $@.tmp $@
stamps/build-gcc-newlib: src/newlib-gcc stamps/build-binutils-newlib
rm -rf $@ $(notdir $@)
mkdir $(notdir $@)
cd $(notdir $@) && $(CURDIR)/$</configure \
--target=riscv$(XLEN)-unknown-elf \
--prefix=$(INSTALL_DIR) \
--disable-shared \
--disable-threads \
--disable-tls \
--enable-languages=c,c++ \
--with-system-zlib \
--with-newlib \
--disable-libmudflap \
--disable-libssp \
--disable-libquadmath \
--disable-libgomp \
--disable-nls \
$(GCC_CHECKING_FLAGS) \
$(MULTILIB_FLAGS) \
$(WITH_ABI) \
$(WITH_ARCH)
$(MAKE) -C $(notdir $@) inhibit-libc=true
$(MAKE) -C $(notdir $@) install
mkdir -p $(dir $@) && touch $@
.PHONY: check-gcc-newlib
check-gcc-newlib: stamps/build-gcc-newlib
export PATH=$(INSTALL_DIR)/bin:$(PATH) && \
export DEJAGNULIBS=$(srcdir)/riscv-dejagnu && \
cd build-gcc-newlib && \
$(MAKE) check-gcc "RUNTESTFLAGS=--target_board=riscv-sim"
check-gcc-linux: stamps/build-gcc-linux-stage2
export PATH=$(srcdir)/scripts/wrapper/qemu:$(INSTALL_DIR)/bin:$(PATH) && \
export DEJAGNULIBS=$(srcdir)/riscv-dejagnu && \
export RISC_V_SYSROOT=$(SYSROOT) && \
cd build-gcc-linux-stage2 && \
$(MAKE) check-gcc "RUNTESTFLAGS=--target_board=riscv-sim"
clean:
rm -rf build-* $(addprefix src/,$(PACKAGES)) stamps
distclean: clean
rm -rf src
# All of the packages install themselves, so our install target does nothing.
install:
RISC-V GNU Compiler Toolchain
=============================
This is the RISC-V C and C++ cross-compiler. It supports two build modes:
a generic ELF/Newlib toolchain and a more sophisticated Linux-ELF/glibc
toolchain.
### Getting the sources
This repository uses submodules. You need the --recursive option to fetch the submodules automatically
$ git clone --recursive https://github.com/riscv/riscv-gnu-toolchain
Alternatively :
$ git clone https://github.com/riscv/riscv-gnu-toolchain
$ cd riscv-gnu-toolchain
$ git submodule update --init --recursive
### Prerequisites
Several standard packages are needed to build the toolchain. On Ubuntu,
executing the following command should suffice:
$ sudo apt-get install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc
On Fedora/CentOS/RHEL OS, executing the following command should suffice:
$ sudo yum install autoconf automake libmpc-devel mpfr-devel gmp-devel gawk bison flex texinfo patchutils gcc gcc-c++
On OS X, you can use [Homebrew](http://brew.sh) to install the dependencies:
$ brew install gawk gnu-sed gmp mpfr libmpc isl
To build the glibc (Linux) on OS X, you will need to build within a case-sensitive file
system. The simplest approach is to create and mount a new disk image with
a case sensitive format. Make sure that the mount point does not contain spaces. This is not necessary to build newlib or gcc itself on OS X.
This process will start by downloading about 200 MiB of upstream sources, then
will patch, build, and install the toolchain. If a local cache of the
upstream sources exists in $(DISTDIR), it will be used; the default location
is /var/cache/distfiles. Your computer will need about 8 GiB of disk space to
complete the process.
### Installation (Newlib)
To build the Newlib cross-compiler, pick an install path. If you choose,
say, `/opt/riscv`, then add `/opt/riscv/bin` to your `PATH` now. Then, simply
run the following command:
./configure --prefix=/opt/riscv
make
You should now be able to use riscv-gcc and its cousins.
### Installation (Linux)
To build the Linux cross-compiler, pick an install path. If you choose,
say, `/opt/riscv`, then add `/opt/riscv/bin` to your `PATH` now. Then, simply
run the following command:
./configure --prefix=/opt/riscv
make linux
### Installation (Linux multilib)
To build the Linux cross-compiler with support for both 32-bit and
64-bit, run the following commands:
./configure --prefix=/opt/riscv --enable-multilib
make linux
The multilib compiler will have the prefix riscv-unknown-linux-gnu-,
rather than the usual prefix (riscv32-... or riscv64-...).
### Advanced Options
There are a number of additional options that may be passed to
configure. See './configure --help' for more details.
### Test Suite
The DejaGnu test suite has been ported to RISC-V. This can run with GDB
simulator for elf toolchain or Qemu for linux toolchain, and GDB simulator
doesn't support floating-point.
To test GCC, run the following commands:
./configure --prefix=$RISCV --disable-linux --with-arch=rv64ima # or --with-arch=rv32ima
make newlib
make check-gcc-newlib
./configure --prefix=$RISCV
make linux
# Need qemu-riscv32 or qemu-riscv64 in your `PATH`.
make check-gcc-linux
This diff is collapsed.
AC_INIT(riscv-toolchain, 1.0)
AC_PROG_CC
AC_PROG_FGREP
AC_PROG_GREP
AC_PATH_PROG([BASH], [bash],
[AC_MSG_ERROR([bash not found])])
AC_PATH_PROGS_FEATURE_CHECK([GAWK], [gawk awk],
[AS_IF([$ac_path_GAWK --version 2>&1 | $FGREP GNU >/dev/null],
[ac_cv_path_GAWK=$ac_path_GAWK ac_path_GAWK_found=:])],
[AC_MSG_ERROR([GNU Awk not found])])
AC_SUBST([GAWK], [$ac_cv_path_GAWK])
AC_PATH_PROGS_FEATURE_CHECK([GSED], [gsed sed],
[AS_IF([$ac_path_GSED --version 2>&1 | $FGREP GNU >/dev/null],
[ac_cv_path_GSED=$ac_path_GSED ac_path_GSED_found=:])],
[AC_MSG_ERROR([GNU sed not found])])
AC_SUBST([GSED], [$ac_cv_path_GSED])
need_gcc_external_libraries="no"
AC_CHECK_LIB(gmp, __gmpz_init, ,
[need_gcc_external_libraries="yes"])
AC_CHECK_LIB(mpfr, mpfr_init, ,
[need_gcc_external_libraries="yes"])
AC_CHECK_LIB(mpc, mpc_init2, ,
[need_gcc_external_libraries="yes"])
AS_IF([test x"$need_gcc_external_libraries" != xno],
[AC_SUBST(NEED_GCC_EXTERNAL_LIBRARIES,true)],
[AC_SUBST(NEED_GCC_EXTERNAL_LIBRARIES,false)])
AC_PATH_PROG([CURL], [curl], [no])
AC_PATH_PROG([WGET], [wget], [no])
AC_PATH_PROG([FTP], [ftp], [no])
AS_IF([test x"$CURL" != xno], [FETCHER="$CURL -L -o - --ftp-pasv --retry 10"],
[test x"$WGET" != xno], [FETCHER="$WGET -O -"],
[test x"$FTP" != xno], [FETCHER="$FTP -o - -p"],
[AC_MSG_ERROR([no file transfer utility found])])
AC_SUBST(FETCHER)
AC_ARG_ENABLE(linux,
[AS_HELP_STRING([--enable-linux],
[set linux as the default make target @<:@--disable-linux@:>@])],
[],
[enable_linux=no]
)
AS_IF([test "x$enable_linux" != xno],
[AC_SUBST(default_target, linux)],
[AC_SUBST(default_target, newlib)])
AC_ARG_ENABLE(atomic,
[AS_HELP_STRING([--disable-atomic],
[disable use of atomic memory instructions in glibc @<:@--enable-atomic@:>@])],
[],
[enable_atomic=yes]
)
AC_ARG_WITH(arch,
[AS_HELP_STRING([--with-arch=rv64g],
[Sets the base RISC-V ISA, defaults to rv64g])],
AC_SUBST(WITH_ARCH, --with-arch=$withval),
AC_SUBST(WITH_ARCH, --with-arch=rv64g)
)
AC_ARG_WITH(abi,
[AS_HELP_STRING([--with-abi=lp64d],
[Sets the base RISC-V ABI, defaults to lp64d])],
[],
[with_abi=default]
)
AS_IF([test "x$with_abi" == xdefault],
[AS_CASE([$with_arch],
[*rv64g | *rv64*d*], [with_abi=lp64d],
[*rv64*f*], [with_abi=lp64f],
[*rv64*], [with_abi=lp64],
[*rv32g | *rv32*d*], [with_abi=ilp32d],
[*rv32*f*], [with_abi=ilp32f],
[*rv32*], [with_abi=ilp32],
[AC_MSG_ERROR([Unknown arch])]
)])
AC_SUBST(WITH_ABI, --with-abi=$with_abi)
AC_ARG_ENABLE(multilib,
[AS_HELP_STRING([--enable-multilib],
[build both RV32 and RV64 runtime libraries @<:@--disable-multilib@:>@])],
[],
[enable_multilib=no]
)
AS_IF([test "x$enable_multilib" != xno],
[AC_SUBST(multilib_flags,--enable-multilib)],
[AC_SUBST(multilib_flags,--disable-multilib)])
AS_IF([test "x$enable_multilib" != xno],
[AC_SUBST(multilib_names,"rv32ima-ilp32 rv32imafd-ilp32d rv64ima-lp64 rv64imafd-lp64d")],
[])
AC_ARG_ENABLE(gcc-checking,
[AS_HELP_STRING([--enable-gcc-checking],
[Enable gcc internal checking, it will make gcc very slow, only enable it when developing gcc @<:@--disable-gcc-checking@:>@])],
[],
[enable_gcc_checking=yes]
)
AS_IF([test "x$enable_gcc_checking" != xno],
[AC_SUBST(gcc_checking, --enable-checking=yes)],
[AC_SUBST(gcc_checking, --enable-checking=release)])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([scripts/wrapper/awk/awk], [chmod +x scripts/wrapper/awk])
AC_CONFIG_FILES([scripts/wrapper/sed/sed], [chmod +x scripts/wrapper/sed])
AC_OUTPUT
#ifndef __ASM_GENERIC_AUXVEC_H
#define __ASM_GENERIC_AUXVEC_H
/*
* Not all architectures need their own auxvec.h, the most
* common definitions are already in linux/auxvec.h.
*/
#endif /* __ASM_GENERIC_AUXVEC_H */
#ifndef __ASM_GENERIC_BITS_PER_LONG
#define __ASM_GENERIC_BITS_PER_LONG
/*
* There seems to be no way of detecting this automatically from user
* space, so 64 bit architectures should override this in their
* bitsperlong.h. In particular, an architecture that supports
* both 32 and 64 bit user space must not rely on CONFIG_64BIT
* to decide it, but rather check a compiler provided macro.
*/
#ifndef __BITS_PER_LONG
#define __BITS_PER_LONG 32
#endif
#endif /* __ASM_GENERIC_BITS_PER_LONG */
#ifndef _ASM_GENERIC_ERRNO_BASE_H
#define _ASM_GENERIC_ERRNO_BASE_H
#define EPERM 1 /* Operation not permitted */
#define ENOENT 2 /* No such file or directory */
#define ESRCH 3 /* No such process */
#define EINTR 4 /* Interrupted system call */
#define EIO 5 /* I/O error */
#define ENXIO 6 /* No such device or address */
#define E2BIG 7 /* Argument list too long */
#define ENOEXEC 8 /* Exec format error */
#define EBADF 9 /* Bad file number */
#define ECHILD 10 /* No child processes */
#define EAGAIN 11 /* Try again */
#define ENOMEM 12 /* Out of memory */
#define EACCES 13 /* Permission denied */
#define EFAULT 14 /* Bad address */
#define ENOTBLK 15 /* Block device required */
#define EBUSY 16 /* Device or resource busy */
#define EEXIST 17 /* File exists */
#define EXDEV 18 /* Cross-device link */
#define ENODEV 19 /* No such device */
#define ENOTDIR 20 /* Not a directory */
#define EISDIR 21 /* Is a directory */
#define EINVAL 22 /* Invalid argument */
#define ENFILE 23 /* File table overflow */
#define EMFILE 24 /* Too many open files */
#define ENOTTY 25 /* Not a typewriter */
#define ETXTBSY 26 /* Text file busy */
#define EFBIG 27 /* File too large */
#define ENOSPC 28 /* No space left on device */
#define ESPIPE 29 /* Illegal seek */
#define EROFS 30 /* Read-only file system */
#define EMLINK 31 /* Too many links */
#define EPIPE 32 /* Broken pipe */
#define EDOM 33 /* Math argument out of domain of func */
#define ERANGE 34 /* Math result not representable */
#endif
#ifndef _ASM_GENERIC_ERRNO_H
#define _ASM_GENERIC_ERRNO_H
#include <asm-generic/errno-base.h>
#define EDEADLK 35 /* Resource deadlock would occur */
#define ENAMETOOLONG 36 /* File name too long */
#define ENOLCK 37 /* No record locks available */
/*
* This error code is special: arch syscall entry code will return
* -ENOSYS if users try to call a syscall that doesn't exist. To keep
* failures of syscalls that really do exist distinguishable from
* failures due to attempts to use a nonexistent syscall, syscall
* implementations should refrain from returning -ENOSYS.
*/
#define ENOSYS 38 /* Invalid system call number */
#define ENOTEMPTY 39 /* Directory not empty */
#define ELOOP 40 /* Too many symbolic links encountered */
#define EWOULDBLOCK EAGAIN /* Operation would block */
#define ENOMSG 42 /* No message of desired type */
#define EIDRM 43 /* Identifier removed */
#define ECHRNG 44 /* Channel number out of range */
#define EL2NSYNC 45 /* Level 2 not synchronized */
#define EL3HLT 46 /* Level 3 halted */
#define EL3RST 47 /* Level 3 reset */
#define ELNRNG 48 /* Link number out of range */