Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
dist: bionic
sudo: required
language: c
compiler:
- clang
env:
matrix:
#- ANALYZE=1
- ANALYZE=0
global:
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
- secure: "Lts0gdnm5ZpO0EBhK86Wi86y9spIaXGJr1uiJ1OX5NGmXyrniNx0myJsq9TW8q21pBCX83742VAOS/0ZOihMAW09tPxjkqP97waDIynu1L+eum58T68ftJX2vxtBiYpvD/OLSyy8iBZTVn1/NhcvT4HSHgmXdbu8ukVr1NKwc+R8msMPB9xEj+VIQJoiehzrRDdt5/PNvd4gudT2VYwI5i6RhLLqnIGyfKW3gnRAKYDW7j9KCjX9MA4uZ/V+PIcMBTqM897fccYLLRsAsNnjhH1CblhTVeiGpHAR+FWCL25220BMvUtRTnUw5EsxBntoicCuvOReoZIb/goWaF97mOrMjWECzVmPOYmdWG+U4LGK7tXwrRqfbOwWetwF1G4PpoiFs+DBQDhNWxvyHi+lcm4/T6jqlhZGzAcFF85mLacOgDyNLhg8mJ9GkkLMJcm53+tqNrlZgKayQZcpeOIFg/ceQrY+j6Y4u0Tu9J3ZCqtoHS3xxa5Oqkc1tEN+1W2sNPQp1rZyFkSsP1dHB/70K48jvah+duhO1TReUa1iojOLAMo283nNfvGYdgL+1eDUG9iEWP4dyMR5zEp5RJF5r9FkF1FizyYak1F7Kj/oCyYyPHpxL4BvSLUqWT4ehoCoYdqdiF5NWPQSgyIqGpnt2tcyS/6q2ONArtaIUP3gUQA="

before_install:
- echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
- sudo pip install codecov

addons:
coverity_scan:
project:
name: kraj/musl
notification_email: raj.khem@gmail.com
build_command_prepend: ./configure
build_command: make -j4
branch_pattern: coverity_scan
install:
- sudo apt-get update -qq
- sudo apt-get install -y -qq clang lcov
script:
- if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then ./configure ; fi
- if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then make -j4 ; fi
- if [ "${ANALYZE}" = 1 ]; then make clean ; fi
- if [ "${ANALYZE}" = 1 ]; then /usr/bin/scan-build --status-bugs -v make -j4 ; fi
after_success:
- codecov
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ CFLAGS_AUTO = -Os -pipe
CFLAGS_C99FSE = -std=c99 -ffreestanding -nostdinc

CFLAGS_ALL = $(CFLAGS_C99FSE)
CFLAGS_ALL += -D_XOPEN_SOURCE=700 -I$(srcdir)/arch/$(ARCH) -I$(srcdir)/arch/generic -Iobj/src/internal -I$(srcdir)/src/include -I$(srcdir)/src/internal -Iobj/include -I$(srcdir)/include
CFLAGS_ALL += -D_XOPEN_SOURCE=700 -DSYSLIBDIR='"$(syslibdir)"' -DLIBDIR='"$(libdir)"'
CFLAGS_ALL += -I$(srcdir)/arch/$(ARCH) -I$(srcdir)/arch/generic -Iobj/src/internal -I$(srcdir)/src/include -I$(srcdir)/src/internal -Iobj/include -I$(srcdir)/include
CFLAGS_ALL += $(CPPFLAGS) $(CFLAGS_AUTO) $(CFLAGS)

LDFLAGS_ALL = $(LDFLAGS_AUTO) $(LDFLAGS)
Expand Down Expand Up @@ -210,7 +211,7 @@ $(DESTDIR)$(includedir)/%: $(srcdir)/include/%
$(INSTALL) -D -m 644 $< $@

$(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so
$(INSTALL) -D -l $(libdir)/libc.so $@ || true
$(INSTALL) -D -r $(DESTDIR)$(libdir)/libc.so $@ || true

install-libs: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),)

Expand Down
9 changes: 8 additions & 1 deletion README → README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

musl libc
# musl libc

musl, pronounced like the word "mussel", is an MIT-licensed
implementation of the standard C library targetting the Linux syscall
Expand All @@ -21,3 +21,10 @@ bootstrapping, and Linux distributions built on musl can be found on
the project website:

http://www.musl-libc.org/

[![Build Status](https://travis-ci.org/kraj/musl.svg?branch=kraj%2Fmaster)](https://travis-ci.org/kraj/musl)
<a href="https://scan.coverity.com/projects/kraj-musl">
<img alt="Coverity Scan Build Status"
src="https://scan.coverity.com/projects/12003/badge.svg"/>
</a>
[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/kraj/musl/blob/kraj/master/COPYRIGHT)
11 changes: 11 additions & 0 deletions arch/riscv32/bits/syscall.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@
#define __NR_perf_event_open 241
#define __NR_accept4 242
#define __NR_arch_specific_syscall 244
#define __NR_riscv_hwprobe 258
#define __NR_prlimit64 261
#define __NR_fanotify_init 262
#define __NR_fanotify_mark 263
Expand Down Expand Up @@ -295,6 +296,16 @@
#define __NR_cachestat 451
#define __NR_fchmodat2 452
#define __NR_futex __NR_futex_time64
#define __NR_map_shadow_stack 453
#define __NR_futex_wake 454
#define __NR_futex_wait 455
#define __NR_futex_requeue 456
#define __NR_statmount 457
#define __NR_listmount 458
#define __NR_lsm_get_self_attr 459
#define __NR_lsm_list_modules 461
#define __NR_lsm_set_self_attr 460
#define __NR_mseal 462

#define __NR_sysriscv __NR_arch_specific_syscall
#define __NR_riscv_flush_icache (__NR_sysriscv + 15)
11 changes: 11 additions & 0 deletions arch/riscv64/bits/syscall.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@
#define __NR_accept4 242
#define __NR_recvmmsg 243
#define __NR_arch_specific_syscall 244
#define __NR_riscv_hwprobe 258
#define __NR_wait4 260
#define __NR_prlimit64 261
#define __NR_fanotify_init 262
Expand Down Expand Up @@ -304,6 +305,16 @@
#define __NR_set_mempolicy_home_node 450
#define __NR_cachestat 451
#define __NR_fchmodat2 452
#define __NR_map_shadow_stack 453
#define __NR_futex_wake 454
#define __NR_futex_wait 455
#define __NR_futex_requeue 456
#define __NR_statmount 457
#define __NR_listmount 458
#define __NR_lsm_get_self_attr 459
#define __NR_lsm_list_modules 461
#define __NR_lsm_set_self_attr 460
#define __NR_mseal 462

#define __NR_sysriscv __NR_arch_specific_syscall
#define __NR_riscv_flush_icache (__NR_sysriscv + 15)
4 changes: 2 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -615,10 +615,10 @@ tryldflag LDFLAGS_AUTO -Wl,--exclude-libs=ALL
tryldflag LDFLAGS_AUTO -Wl,--dynamic-list="$srcdir/dynamic.list"

# Find compiler runtime library
test -z "$LIBCC" && tryldflag LIBCC -lgcc && tryldflag LIBCC -lgcc_eh
test -z "$LIBCC" && tryldflag LIBCC -lcompiler_rt
test -z "$LIBCC" && try_libcc=`$CC -print-libgcc-file-name 2>/dev/null` \
&& tryldflag LIBCC "$try_libcc"
test -z "$LIBCC" && tryldflag LIBCC -lgcc && tryldflag LIBCC -lgcc_eh
test -z "$LIBCC" && tryldflag LIBCC -lcompiler_rt
test -z "$LIBCC" && try_libcc=`$CC -print-file-name=libpcc.a 2>/dev/null` \
&& tryldflag LIBCC "$try_libcc"
printf "using compiler runtime libraries: %s\n" "$LIBCC"
Expand Down
3 changes: 3 additions & 0 deletions include/sys/prctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ struct prctl_mm_map {
#define PR_PAC_SET_ENABLED_KEYS 60
#define PR_PAC_GET_ENABLED_KEYS 61

#define PR_SET_VMA 0x53564d41
#define PR_SET_VMA_ANON_NAME 0

int prctl (int, ...);

#ifdef __cplusplus
Expand Down
4 changes: 3 additions & 1 deletion ldso/dynlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ static size_t ldso_page_size;
#define realloc __libc_realloc
#define free __libc_free

#define SYS_PATH_DFLT SYSLIBDIR ":" LIBDIR

static void error_impl(const char *, ...);
static void error_noop(const char *, ...);
static void (*error)(const char *, ...) = error_noop;
Expand Down Expand Up @@ -1157,7 +1159,7 @@ static struct dso *load_library(const char *name, struct dso *needed_by)
sys_path = "";
}
}
if (!sys_path) sys_path = "/lib:/usr/local/lib:/usr/lib";
if (!sys_path) sys_path = SYS_PATH_DFLT;
fd = path_open(name, sys_path, buf, sizeof buf);
}
pathname = buf;
Expand Down
8 changes: 5 additions & 3 deletions tools/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@
#

usage() {
printf "usage: %s [-D] [-l] [-m mode] src dest\n" "$0" 1>&2
printf "usage: %s [-D] [-l] [-r] [-m mode] src dest\n" "$0" 1>&2
exit 1
}

mkdirp=
symlink=
symlinkflags="-s"
mode=755

while getopts Dlm: name ; do
while getopts Dlrm: name ; do
case "$name" in
D) mkdirp=yes ;;
l) symlink=yes ;;
r) symlink=yes; symlinkflags="$symlinkflags -r" ;;
m) mode=$OPTARG ;;
?) usage ;;
esac
Expand Down Expand Up @@ -49,7 +51,7 @@ umask 077

if test "$symlink" ; then
umask 000
ln -s "$1" "$tmp"
ln $symlinkflags "$1" "$tmp"
umask 077
else
cat < "$1" > "$tmp"
Expand Down