diff --git a/stdlib/Makefile b/stdlib/Makefile
index 8b0ac63ddb..d2d912db27 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -51,170 +51,57 @@ headers := \
   ucontext.h \
   # headers
 
-routines := \
-  a64l \
-  abort \
-  abs \
-  arc4random \
-  arc4random_uniform \
-  at_quick_exit \
-  atof \
-  atoi \
-  atol\
-  atoll \
-  bsearch \
-  canonicalize \
-  cxa_at_quick_exit \
-  cxa_atexit \
-  cxa_finalize \
-  cxa_thread_atexit_impl \
-  div \
-  drand48 \
-  drand48-iter \
-  drand48_r \
-  erand48 \
-  erand48_r \
-  exit \
-  fmtmsg \
-  getcontext \
-  getentropy \
-  getenv \
-  getrandom \
-  getsubopt \
-  jrand48 \
-  jrand48_r \
-  l64a \
-  labs \
-  lcong48 \
-  lcong48_r \
-  ldiv \
-  llabs \
-  lldiv \
-  lrand48 \
-  lrand48_r \
-  makecontext \
-  mblen \
-  mbstowcs \
-  mbtowc \
-  mrand48 \
-  mrand48_r \
-  nrand48 \
-  nrand48_r \
-  old_atexit  \
-  on_exit atexit \
-  putenv \
-  qsort \
-  quick_exit \
-  rand \
-  rand_r \
-  random \
-  random_r \
-  rpmatch \
-  secure-getenv \
-  seed48 \
-  seed48_r \
-  setcontext \
-  setenv \
-  srand48 \
-  srand48_r \
-  stdc_bit_ceil_uc \
-  stdc_bit_ceil_ui \
-  stdc_bit_ceil_ul \
-  stdc_bit_ceil_ull \
-  stdc_bit_ceil_us \
-  stdc_bit_floor_uc \
-  stdc_bit_floor_ui \
-  stdc_bit_floor_ul \
-  stdc_bit_floor_ull \
-  stdc_bit_floor_us \
-  stdc_bit_width_uc \
-  stdc_bit_width_ui \
-  stdc_bit_width_ul \
-  stdc_bit_width_ull \
-  stdc_bit_width_us \
-  stdc_count_ones_uc \
-  stdc_count_ones_ui \
-  stdc_count_ones_ul \
-  stdc_count_ones_ull \
-  stdc_count_ones_us \
-  stdc_count_zeros_uc \
-  stdc_count_zeros_ui \
-  stdc_count_zeros_ul \
-  stdc_count_zeros_ull \
-  stdc_count_zeros_us \
-  stdc_first_leading_one_uc \
-  stdc_first_leading_one_ui \
-  stdc_first_leading_one_ul \
-  stdc_first_leading_one_ull \
-  stdc_first_leading_one_us \
-  stdc_first_leading_zero_uc \
-  stdc_first_leading_zero_ui \
-  stdc_first_leading_zero_ul \
-  stdc_first_leading_zero_ull \
-  stdc_first_leading_zero_us \
-  stdc_first_trailing_one_uc \
-  stdc_first_trailing_one_ui \
-  stdc_first_trailing_one_ul \
-  stdc_first_trailing_one_ull \
-  stdc_first_trailing_one_us \
-  stdc_first_trailing_zero_uc \
-  stdc_first_trailing_zero_ui \
-  stdc_first_trailing_zero_ul \
-  stdc_first_trailing_zero_ull \
-  stdc_first_trailing_zero_us \
-  stdc_has_single_bit_uc \
-  stdc_has_single_bit_ui \
-  stdc_has_single_bit_ul \
-  stdc_has_single_bit_ull \
-  stdc_has_single_bit_us \
-  stdc_leading_ones_uc \
-  stdc_leading_ones_ui \
-  stdc_leading_ones_ul \
-  stdc_leading_ones_ull \
-  stdc_leading_ones_us \
-  stdc_leading_zeros_uc \
-  stdc_leading_zeros_ui \
-  stdc_leading_zeros_ul \
-  stdc_leading_zeros_ull \
-  stdc_leading_zeros_us \
-  stdc_trailing_ones_uc \
-  stdc_trailing_ones_ui \
-  stdc_trailing_ones_ul \
-  stdc_trailing_ones_ull \
-  stdc_trailing_ones_us \
-  stdc_trailing_zeros_uc \
-  stdc_trailing_zeros_ui \
-  stdc_trailing_zeros_ul \
-  stdc_trailing_zeros_ull \
-  stdc_trailing_zeros_us \
-  strfmon \
-  strfmon_l \
-  strfromd \
-  strfromf \
-  strfroml \
-  strtod \
-  strtod_l \
-  strtod_nan \
-  strtof \
-  strtof_l \
-  strtof_nan \
-  strtol \
-  strtol_l \
-  strtold \
-  strtold_l \
-  strtold_nan \
-  strtoll \
-  strtoll_l \
-  strtoul \
-  strtoul_l \
-  strtoull \
-  strtoull_l \
-  swapcontext \
-  system \
-  wcstombs \
-  wctomb  \
-  xpg_basename \
-  # routines
+routines        :=                                                                           \
+        atof atoi atol atoll                                                                 \
+        abort                                                                                \
+        bsearch qsort                                                                        \
+        getenv putenv setenv secure-getenv                                                   \
+        exit on_exit atexit cxa_atexit cxa_finalize old_atexit                               \
+        quick_exit at_quick_exit cxa_at_quick_exit cxa_thread_atexit_impl                    \
+        abs labs llabs                                                                       \
+        div ldiv lldiv                                                                       \
+        mblen mbstowcs mbtowc wcstombs wctomb                                                \
+        arc4random arc4random_uniform                                                        \
+        random random_r rand rand_r                                                          \
+        drand48 erand48 lrand48 nrand48 mrand48 jrand48                                      \
+        srand48 seed48 lcong48                                                               \
+        drand48_r erand48_r lrand48_r nrand48_r mrand48_r jrand48_r                          \
+        srand48_r seed48_r lcong48_r                                                         \
+        drand48-iter getrandom getentropy                                                    \
+        strfromf strfromd strfroml                                                           \
+        strtol strtoul strtoll strtoull                                                      \
+        strtol_l strtoul_l strtoll_l strtoull_l                                              \
+        strtof strtod strtold                                                                \
+        strtof_l strtod_l strtold_l                                                          \
+        strtof_nan strtod_nan strtold_nan                                                    \
+        system canonicalize                                                                  \
+        stdc_bit_ceil_uc stdc_bit_ceil_ui stdc_bit_ceil_ul                                   \
+        stdc_bit_ceil_ull stdc_bit_ceil_us stdc_bit_floor_uc                                 \
+        stdc_bit_floor_ui stdc_bit_floor_ul stdc_bit_floor_ull                               \
+        stdc_bit_floor_us stdc_bit_width_uc stdc_bit_width_ui                                \
+        stdc_bit_width_ul stdc_bit_width_ull stdc_bit_width_us                               \
+        stdc_count_ones_uc stdc_count_ones_ui stdc_count_ones_ul                             \
+        stdc_count_ones_ull stdc_count_ones_us stdc_count_zeros_uc                           \
+        stdc_count_zeros_ui stdc_count_zeros_ul stdc_count_zeros_ull                         \
+        stdc_count_zeros_us stdc_first_leading_one_uc stdc_first_leading_one_ui              \
+        stdc_first_leading_one_ul stdc_first_leading_one_ull stdc_first_leading_one_us       \
+        stdc_first_leading_zero_uc stdc_first_leading_zero_ui stdc_first_leading_zero_ul     \
+        stdc_first_leading_zero_ull stdc_first_leading_zero_us stdc_first_trailing_one_uc    \
+        stdc_first_trailing_one_ui stdc_first_trailing_one_ul stdc_first_trailing_one_ull    \
+        stdc_first_trailing_one_us stdc_first_trailing_zero_uc stdc_first_trailing_zero_ui   \
+        stdc_first_trailing_zero_ul stdc_first_trailing_zero_ull stdc_first_trailing_zero_us \
+        stdc_has_single_bit_uc stdc_has_single_bit_ui stdc_has_single_bit_ul                 \
+        stdc_has_single_bit_ull stdc_has_single_bit_us stdc_leading_ones_uc                  \
+        stdc_leading_ones_ui stdc_leading_ones_ul stdc_leading_ones_ull                      \
+        stdc_leading_ones_us stdc_leading_zeros_uc stdc_leading_zeros_ui                     \
+        stdc_leading_zeros_ul stdc_leading_zeros_ull stdc_leading_zeros_us                   \
+        stdc_trailing_ones_uc stdc_trailing_ones_ui stdc_trailing_ones_ul                    \
+        stdc_trailing_ones_ull stdc_trailing_ones_us stdc_trailing_zeros_uc                  \
+        stdc_trailing_zeros_ui stdc_trailing_zeros_ul stdc_trailing_zeros_ull                \
+        stdc_trailing_zeros_us                                                               \
+        a64l l64a                                                                            \
+        rpmatch strfmon strfmon_l getsubopt xpg_basename fmtmsg                              \
+        getcontext setcontext makecontext swapcontext
 
 # Exclude fortified routines from being built with _FORTIFY_SOURCE
 routines_no_fortify += \
