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

Compile fails on Alpine Linux #74

Open
xanview opened this Issue Mar 12, 2016 · 4 comments

Comments

Projects
None yet
4 participants
@ghost

ghost commented Mar 12, 2016

Any ideas?

$ bundle config --local build.sigar '--with-cppflags="-fgnu89-inline"'  && gem install sigar -v '0.7.3'
Building native extensions.  This could take a while...
ERROR:  Error installing sigar:
    ERROR: Failed to build gem native extension.

    current directory: /usr/local/bundle/gems/sigar-0.7.3/bindings/ruby
/usr/local/bin/ruby -r ./siteconf20160312-10-dqsh82.rb extconf.rb
Ruby platform=x86_64-linux
rbsigar_generated.rx needs update
generating rbsigar_generated.rx
fatal: Not a git repository (or any of the parent directories): .git
../../src/sigar_cache.c -> sigar_cache.c
../../src/sigar_fileinfo.c -> sigar_fileinfo.c
../../src/sigar.c -> sigar.c
../../src/sigar_ptql.c -> sigar_ptql.c
../../src/sigar_format.c -> sigar_format.c
../../src/sigar_util.c -> sigar_util.c
../../src/sigar_getline.c -> sigar_getline.c
../../src/sigar_signal.c -> sigar_signal.c
../../src/os/linux/linux_sigar.c -> linux_sigar.c
creating Makefile

current directory: /usr/local/bundle/gems/sigar-0.7.3/bindings/ruby
make "DESTDIR=" clean

current directory: /usr/local/bundle/gems/sigar-0.7.3/bindings/ruby
make "DESTDIR="
compiling sigar_cache.c
sigar_cache.c: In function 'sigar_cache_dump':
sigar_cache.c:67:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (i=0; i<table->size; i++) {
                ^
sigar_cache.c:72:20: warning: format '%lld' expects argument of type 'long long int', but argument 2 has type 'sigar_uint64_t {aka long unsigned int}' [-Wformat=]
             printf("%lld", entry->id);
                    ^
sigar_cache.c: In function 'sigar_cache_rehash':
sigar_cache.c:94:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (i=0; i<table->size; i++) {
                ^
sigar_cache.c: In function 'sigar_perform_cleanup_if_necessary':
sigar_cache.c:119:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (table->cleanup_period_millis == SIGAR_FIELD_NOTIMPL) {
                                      ^
sigar_cache.c:134:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (i=0; i<table->size; i++) {
                ^
sigar_cache.c: In function 'sigar_cache_destroy':
sigar_cache.c:237:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (i=0; i<table->size; i++) {
                ^
In file included from sigar_cache.c:19:0:
sigar_cache.c: At top level:
../../include/sigar_util.h:82:20: warning: inline function 'sigar_skip_multiple_token' declared but never defined
 SIGAR_INLINE char *sigar_skip_multiple_token(char *p, int count);
                    ^
../../include/sigar_util.h:80:20: warning: inline function 'sigar_skip_token' declared but never defined
 SIGAR_INLINE char *sigar_skip_token(char *p);
                    ^
../../include/sigar_util.h:78:20: warning: inline function 'sigar_skip_line' declared but never defined
 SIGAR_INLINE char *sigar_skip_line(char *buffer, int buflen);
                    ^
compiling sigar_fileinfo.c
compiling sigar.c
sigar.c: In function 'get_io_diff':
sigar.c:190:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    if ( current_value == SIGAR_FIELD_NOTIMPL ) {
                       ^
sigar.c:195:20: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
    if (int_io_diff >=0) {
                    ^
sigar.c: In function 'sigar_proc_disk_io_get':
sigar.c:245:16: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
  if (time_diff < 0) {
                ^
sigar.c: In function 'sigar_dump_pid_cache_get':
sigar.c:277:35: warning: passing argument 2 of 'get_cache_info' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   get_cache_info(sigar->proc_cpu, "proc cpu cache");
                                   ^
sigar.c:266:6: note: expected 'char *' but argument is of type 'const char *'
 void get_cache_info(sigar_cache_t * cache, char * name){
      ^
sigar.c:278:34: warning: passing argument 2 of 'get_cache_info' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   get_cache_info(sigar->proc_io, "proc io cache");
                                  ^
sigar.c:266:6: note: expected 'char *' but argument is of type 'const char *'
 void get_cache_info(sigar_cache_t * cache, char * name){
      ^
sigar.c: In function 'sigar_proc_stat_get':
sigar.c:298:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (i=0; i<pids->number; i++) {
                ^
sigar.c:306:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if (state.threads != SIGAR_FIELD_NOTIMPL) {
                           ^
sigar.c: In function 'sigar_get_default_gateway':
sigar.c:1303:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (i=0; i<routelist.number; i++) {
                ^
sigar.c: In function 'get_interface_type':
sigar.c:1565:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         type = SIGAR_NIC_SLIP;
              ^
sigar.c:1568:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         type = SIGAR_NIC_CSLIP;
              ^
sigar.c:1571:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         type = SIGAR_NIC_SLIP6;
              ^
sigar.c:1574:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         type = SIGAR_NIC_CSLIP6;
              ^
sigar.c:1577:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         type = SIGAR_NIC_ADAPTIVE;
              ^
sigar.c:1580:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         type = SIGAR_NIC_ETHERNET;
              ^
sigar.c:1583:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         type = SIGAR_NIC_ASH;
              ^
sigar.c:1586:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         type = SIGAR_NIC_FDDI;
              ^
sigar.c:1589:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         type = SIGAR_NIC_HIPPI;
              ^
sigar.c:1592:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         type = SIGAR_NIC_AX25;
              ^
sigar.c:1595:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         type = SIGAR_NIC_ROSE;
              ^
sigar.c:1598:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         type = SIGAR_NIC_NETROM;
              ^
sigar.c:1601:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         type = SIGAR_NIC_X25;
              ^
sigar.c:1604:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         type = SIGAR_NIC_TUNNEL;
              ^
sigar.c:1607:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         type = SIGAR_NIC_PPP;
              ^
sigar.c:1610:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         type = SIGAR_NIC_HDLC;
              ^
sigar.c:1613:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         type = SIGAR_NIC_LAPB;
              ^
sigar.c:1616:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         type = SIGAR_NIC_ARCNET;
              ^
sigar.c:1619:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         type = SIGAR_NIC_DLCI;
              ^
sigar.c:1622:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         type = SIGAR_NIC_FRAD;
              ^
sigar.c:1625:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         type = SIGAR_NIC_SIT;
              ^
sigar.c:1628:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         type = SIGAR_NIC_IRDA;
              ^
sigar.c:1631:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         type = SIGAR_NIC_EC;
              ^
sigar.c:1634:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         type = SIGAR_NIC_UNSPEC;
              ^
sigar.c: In function 'sigar_net_interface_config_primary_get':
sigar.c:1977:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (i=0; i<iflist.number; i++) {
                ^
sigar.c: In function 'sigar_fqdn_get':
sigar.c:2157:19: warning: passing argument 3 of 'sigar_log' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
                   "[fqdn] resolved using gethostbyname.h_name");
                   ^
In file included from ../../include/sigar_private.h:22:0,
                 from sigar.c:40:
../../include/sigar_log.h:67:21: note: expected 'char *' but argument is of type 'const char *'
 SIGAR_DECLARE(void) sigar_log(sigar_t *sigar, int level, char *message);
                     ^
sigar.c:2174:27: warning: passing argument 3 of 'sigar_log' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
                           "[fqdn] resolved using gethostbyname.h_aliases");
                           ^
In file included from ../../include/sigar_private.h:22:0,
                 from sigar.c:40:
../../include/sigar_log.h:67:21: note: expected 'char *' but argument is of type 'const char *'
 SIGAR_DECLARE(void) sigar_log(sigar_t *sigar, int level, char *message);
                     ^
sigar.c:2221:27: warning: passing argument 3 of 'sigar_log' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
                           "[fqdn] resolved using gethostbyaddr.h_name");
                           ^
In file included from ../../include/sigar_private.h:22:0,
                 from sigar.c:40:
../../include/sigar_log.h:67:21: note: expected 'char *' but argument is of type 'const char *'
 SIGAR_DECLARE(void) sigar_log(sigar_t *sigar, int level, char *message);
                     ^
sigar.c:2237:35: warning: passing argument 3 of 'sigar_log' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
                                   "[fqdn] resolved using "
                                   ^
In file included from ../../include/sigar_private.h:22:0,
                 from sigar.c:40:
../../include/sigar_log.h:67:21: note: expected 'char *' but argument is of type 'const char *'
 SIGAR_DECLARE(void) sigar_log(sigar_t *sigar, int level, char *message);
                     ^
sigar.c:2253:15: warning: passing argument 3 of 'sigar_log' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
               "[fqdn] unresolved using gethostbyname.h_addr_list");
               ^
In file included from ../../include/sigar_private.h:22:0,
                 from sigar.c:40:
../../include/sigar_log.h:67:21: note: expected 'char *' but argument is of type 'const char *'
 SIGAR_DECLARE(void) sigar_log(sigar_t *sigar, int level, char *message);
                     ^
sigar.c:2270:19: warning: passing argument 3 of 'sigar_log' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
                   "[fqdn] resolved using getdomainname");
                   ^
In file included from ../../include/sigar_private.h:22:0,
                 from sigar.c:40:
../../include/sigar_log.h:67:21: note: expected 'char *' but argument is of type 'const char *'
 SIGAR_DECLARE(void) sigar_log(sigar_t *sigar, int level, char *message);
                     ^
sigar.c:2274:19: warning: passing argument 3 of 'sigar_log' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
                   "[fqdn] getdomainname failed");
                   ^
In file included from ../../include/sigar_private.h:22:0,
                 from sigar.c:40:
../../include/sigar_log.h:67:21: note: expected 'char *' but argument is of type 'const char *'
 SIGAR_DECLARE(void) sigar_log(sigar_t *sigar, int level, char *message);
                     ^
In file included from sigar.c:41:0:
sigar.c: At top level:
../../include/sigar_util.h:82:20: warning: inline function 'sigar_skip_multiple_token' declared but never defined
 SIGAR_INLINE char *sigar_skip_multiple_token(char *p, int count);
                    ^
../../include/sigar_util.h:80:20: warning: inline function 'sigar_skip_token' declared but never defined
 SIGAR_INLINE char *sigar_skip_token(char *p);
                    ^
../../include/sigar_util.h:78:20: warning: inline function 'sigar_skip_line' declared but never defined
 SIGAR_INLINE char *sigar_skip_line(char *buffer, int buflen);
                    ^
compiling sigar_ptql.c
sigar_ptql.c: In function 'ptql_branch_list_destroy':
sigar_ptql.c:540:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (i=0; i<branches->number; i++) {
                    ^
sigar_ptql.c: In function 'ptql_pid_list_get':
sigar_ptql.c:1077:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (i=0; i<sigar->pids->number; i++) {
                ^
sigar_ptql.c: In function 'ptql_args_match':
sigar_ptql.c:1134:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (i=0; i<args.number; i++) {
                    ^
sigar_ptql.c:1150:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if ((num >= 0) && (num < args.number)) {
                                ^
sigar_ptql.c: At top level:
sigar_ptql.c:1325:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "StartTime", PTQL_LOOKUP_ENTRY(proc_time, start_time, UI64) },
       ^
sigar_ptql.c:1326:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "User",      PTQL_LOOKUP_ENTRY(proc_time, user, UI64) },
       ^
sigar_ptql.c:1327:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Sys",       PTQL_LOOKUP_ENTRY(proc_time, sys, UI64) },
       ^
sigar_ptql.c:1328:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Total",     PTQL_LOOKUP_ENTRY(proc_time, total, UI64) },
       ^
sigar_ptql.c:1333:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "StartTime", PTQL_LOOKUP_ENTRY(proc_cpu, start_time, UI64) },
       ^
sigar_ptql.c:1334:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "User",      PTQL_LOOKUP_ENTRY(proc_cpu, user, UI64) },
       ^
sigar_ptql.c:1335:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Sys",       PTQL_LOOKUP_ENTRY(proc_cpu, sys, UI64) },
       ^
sigar_ptql.c:1336:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Total",     PTQL_LOOKUP_ENTRY(proc_cpu, total, UI64) },
       ^
sigar_ptql.c:1337:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Percent",   PTQL_LOOKUP_ENTRY(proc_cpu, percent, DBL) },
       ^
sigar_ptql.c:1342:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "BytesRead", PTQL_LOOKUP_ENTRY(proc_disk_io, bytes_read, UI64) },
       ^
sigar_ptql.c:1343:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "BytesWritten",      PTQL_LOOKUP_ENTRY(proc_disk_io, bytes_written, UI64) },
       ^
sigar_ptql.c:1344:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "BytesTotal",       PTQL_LOOKUP_ENTRY(proc_disk_io, bytes_total, UI64) },
       ^
sigar_ptql.c:1350:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "User",  PTQL_LOOKUP_ENTRY(proc_cred_name, user, STR) },
       ^
sigar_ptql.c:1351:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Group", PTQL_LOOKUP_ENTRY(proc_cred_name, group, STR) },
       ^
sigar_ptql.c:1356:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Size",        PTQL_LOOKUP_ENTRY(proc_mem, size, UI64) },
       ^
sigar_ptql.c:1357:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Resident",    PTQL_LOOKUP_ENTRY(proc_mem, resident, UI64) },
       ^
sigar_ptql.c:1358:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Share",       PTQL_LOOKUP_ENTRY(proc_mem, share, UI64) },
       ^
sigar_ptql.c:1359:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "MinorFaults", PTQL_LOOKUP_ENTRY(proc_mem, minor_faults, UI64) },
       ^
sigar_ptql.c:1360:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "MajorFaults", PTQL_LOOKUP_ENTRY(proc_mem, major_faults, UI64) },
       ^
sigar_ptql.c:1361:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "PageFaults",  PTQL_LOOKUP_ENTRY(proc_mem, page_faults, UI64) },
       ^
sigar_ptql.c:1366:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Name", PTQL_LOOKUP_ENTRY(proc_exe, name, STR) },
       ^
sigar_ptql.c:1367:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Cwd",  PTQL_LOOKUP_ENTRY(proc_exe, cwd, STR) },
       ^
sigar_ptql.c:1372:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Uid",  PTQL_LOOKUP_ENTRY(proc_cred, uid, UID) },
       ^
sigar_ptql.c:1373:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Gid",  PTQL_LOOKUP_ENTRY(proc_cred, gid, UID) },
       ^
sigar_ptql.c:1374:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Euid", PTQL_LOOKUP_ENTRY(proc_cred, euid, UID) },
       ^
sigar_ptql.c:1375:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Egid", PTQL_LOOKUP_ENTRY(proc_cred, egid, UID) },
       ^
sigar_ptql.c:1380:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "State",     PTQL_LOOKUP_ENTRY(proc_state, state, CHR) },
       ^
sigar_ptql.c:1381:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Name",      PTQL_LOOKUP_ENTRY(proc_state, name, STR) },
       ^
sigar_ptql.c:1382:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Ppid",      PTQL_LOOKUP_ENTRY(proc_state, ppid, PID) },
       ^
sigar_ptql.c:1383:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Tty",       PTQL_LOOKUP_ENTRY(proc_state, tty, UI32) },
       ^
sigar_ptql.c:1384:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Nice",      PTQL_LOOKUP_ENTRY(proc_state, nice, UI32) },
       ^
sigar_ptql.c:1385:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Priority",  PTQL_LOOKUP_ENTRY(proc_state, priority, UI32) },
       ^
sigar_ptql.c:1386:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Threads",   PTQL_LOOKUP_ENTRY(proc_state, threads, UI64) },
       ^
sigar_ptql.c:1387:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Processor", PTQL_LOOKUP_ENTRY(proc_state, processor, UI32) },
       ^
sigar_ptql.c:1392:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Total", PTQL_LOOKUP_ENTRY(proc_fd, total, UI64) },
       ^
sigar_ptql.c:1421:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Time",     PTQL_Time },
       ^
sigar_ptql.c:1422:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Cpu",      PTQL_Cpu },
       ^
sigar_ptql.c:1423:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "CredName", PTQL_CredName },
       ^
sigar_ptql.c:1424:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Mem",      PTQL_Mem },
       ^
sigar_ptql.c:1425:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Exe",      PTQL_Exe },
       ^
sigar_ptql.c:1426:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Cred",     PTQL_Cred },
       ^
sigar_ptql.c:1427:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "State",    PTQL_State },
       ^
sigar_ptql.c:1428:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Fd",       PTQL_Fd },
       ^
sigar_ptql.c:1429:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Args",     PTQL_Args },
       ^
sigar_ptql.c:1430:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Modules",  PTQL_Modules },
       ^
sigar_ptql.c:1431:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Env",      PTQL_Env },
       ^
sigar_ptql.c:1432:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Port",     PTQL_Port },
       ^
sigar_ptql.c:1433:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Pid",      PTQL_Pid },
       ^
sigar_ptql.c:1434:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Service",  PTQL_Service },
       ^
sigar_ptql.c:1435:7: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     { "Disk_IO",   PTQL_Disk_IO },
       ^
sigar_ptql.c: In function 'ptql_branch_parse':
sigar_ptql.c:1497:22: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         branch->attr = "Name";
                      ^
sigar_ptql.c: In function 'sigar_ptql_query_match':
sigar_ptql.c:1777:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (i=0; i<query->branches.number; i++) {
                ^
sigar_ptql.c: In function 'ptql_proc_list_get':
sigar_ptql.c:1845:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (i=0; i<query->branches.number; i++) {
                ^
sigar_ptql.c: In function 'sigar_ptql_query_find_process':
sigar_ptql.c:1901:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (i=0; i<pids->number; i++) {
                ^
sigar_ptql.c:1927:28: warning: passing argument 2 of 'sigar_strerror_set' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
                            "Query did not match any processes");
                            ^
In file included from sigar_ptql.c:20:0:
../../include/sigar_private.h:184:6: note: expected 'char *' but argument is of type 'const char *'
 void sigar_strerror_set(sigar_t *sigar, char *msg);
      ^
sigar_ptql.c: In function 'sigar_ptql_query_find':
sigar_ptql.c:1953:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (i=0; i<pids->number; i++) {
                ^
In file included from sigar_ptql.c:21:0:
sigar_ptql.c: At top level:
../../include/sigar_util.h:82:20: warning: inline function 'sigar_skip_multiple_token' declared but never defined
 SIGAR_INLINE char *sigar_skip_multiple_token(char *p, int count);
                    ^
../../include/sigar_util.h:80:20: warning: inline function 'sigar_skip_token' declared but never defined
 SIGAR_INLINE char *sigar_skip_token(char *p);
                    ^
../../include/sigar_util.h:78:20: warning: inline function 'sigar_skip_line' declared but never defined
 SIGAR_INLINE char *sigar_skip_line(char *buffer, int buflen);
                    ^
compiling sigar_format.c
sigar_format.c: In function 'sigar_error_string':
sigar_format.c:131:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "This function has not been implemented on this platform";
                ^
sigar_format.c:133:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "Error string not specified yet";
                ^
sigar_format.c: In function 'sigar_strerror':
sigar_format.c:149:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "Unknown OS Error"; /* should never happen */
                ^
sigar_format.c: In function 'sigar_strerror_get':
sigar_format.c:180:9: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     buf = strerror_r(err, errbuf, buflen);
         ^
sigar_format.c: In function 'sigar_format_size':
sigar_format.c:223:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (size == SIGAR_FIELD_NOTIMPL) {
              ^
sigar_format.c: In function 'net_services_parse':
sigar_format.c:583:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         file = NET_SERVICES_FILE;
              ^
sigar_format.c: In function 'sigar_net_services_name_get':
sigar_format.c:629:15: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         pname = "tcp";
               ^
sigar_format.c:633:15: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         pname = "udp";
               ^
In file included from sigar_format.c:23:0:
sigar_format.c: At top level:
../../include/sigar_util.h:82:20: warning: inline function 'sigar_skip_multiple_token' declared but never defined
 SIGAR_INLINE char *sigar_skip_multiple_token(char *p, int count);
                    ^
../../include/sigar_util.h:80:20: warning: inline function 'sigar_skip_token' declared but never defined
 SIGAR_INLINE char *sigar_skip_token(char *p);
                    ^
../../include/sigar_util.h:78:20: warning: inline function 'sigar_skip_line' declared but never defined
 SIGAR_INLINE char *sigar_skip_line(char *buffer, int buflen);
                    ^
compiling linux_sigar.c
linux_sigar.c: In function 'sigar_mem_get':
linux_sigar.c:335:55: warning: passing argument 2 of 'sigar_meminfo' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     mem->total  = sigar_meminfo(buffer, MEMINFO_PARAM("MemTotal"));
                                                       ^
linux_sigar.c:298:26: note: in definition of macro 'MEMINFO_PARAM'
 #define MEMINFO_PARAM(a) a ":", SSTRLEN(a ":")
                          ^
linux_sigar.c:300:36: note: expected 'char *' but argument is of type 'const char *'
 static SIGAR_INLINE sigar_uint64_t sigar_meminfo(char *buffer,
                                    ^
linux_sigar.c:336:55: warning: passing argument 2 of 'sigar_meminfo' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     mem->free   = sigar_meminfo(buffer, MEMINFO_PARAM("MemFree"));
                                                       ^
linux_sigar.c:298:26: note: in definition of macro 'MEMINFO_PARAM'
 #define MEMINFO_PARAM(a) a ":", SSTRLEN(a ":")
                          ^
linux_sigar.c:300:36: note: expected 'char *' but argument is of type 'const char *'
 static SIGAR_INLINE sigar_uint64_t sigar_meminfo(char *buffer,
                                    ^
linux_sigar.c:339:51: warning: passing argument 2 of 'sigar_meminfo' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     buffers = sigar_meminfo(buffer, MEMINFO_PARAM("Buffers"));
                                                   ^
linux_sigar.c:298:26: note: in definition of macro 'MEMINFO_PARAM'
 #define MEMINFO_PARAM(a) a ":", SSTRLEN(a ":")
                          ^
linux_sigar.c:300:36: note: expected 'char *' but argument is of type 'const char *'
 static SIGAR_INLINE sigar_uint64_t sigar_meminfo(char *buffer,
                                    ^
linux_sigar.c:340:51: warning: passing argument 2 of 'sigar_meminfo' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     cached  = sigar_meminfo(buffer, MEMINFO_PARAM("Cached"));
                                                   ^
linux_sigar.c:298:26: note: in definition of macro 'MEMINFO_PARAM'
 #define MEMINFO_PARAM(a) a ":", SSTRLEN(a ":")
                          ^
linux_sigar.c:300:36: note: expected 'char *' but argument is of type 'const char *'
 static SIGAR_INLINE sigar_uint64_t sigar_meminfo(char *buffer,
                                    ^
linux_sigar.c: In function 'sigar_swap_get':
linux_sigar.c:367:56: warning: passing argument 2 of 'sigar_meminfo' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     swap->total  = sigar_meminfo(buffer, MEMINFO_PARAM("SwapTotal"));
                                                        ^
linux_sigar.c:298:26: note: in definition of macro 'MEMINFO_PARAM'
 #define MEMINFO_PARAM(a) a ":", SSTRLEN(a ":")
                          ^
linux_sigar.c:300:36: note: expected 'char *' but argument is of type 'const char *'
 static SIGAR_INLINE sigar_uint64_t sigar_meminfo(char *buffer,
                                    ^
linux_sigar.c:368:56: warning: passing argument 2 of 'sigar_meminfo' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     swap->free   = sigar_meminfo(buffer, MEMINFO_PARAM("SwapFree"));
                                                        ^
linux_sigar.c:298:26: note: in definition of macro 'MEMINFO_PARAM'
 #define MEMINFO_PARAM(a) a ":", SSTRLEN(a ":")
                          ^
linux_sigar.c:300:36: note: expected 'char *' but argument is of type 'const char *'
 static SIGAR_INLINE sigar_uint64_t sigar_meminfo(char *buffer,
                                    ^
linux_sigar.c: In function 'sigar_proc_cumulative_disk_io_get':
linux_sigar.c:792:72: warning: passing argument 2 of 'get_named_proc_token' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     proc_cumulative_disk_io->bytes_read = get_named_proc_token(buffer, "\nread_bytes");
                                                                        ^
linux_sigar.c:771:29: note: expected 'char *' but argument is of type 'const char *'
 SIGAR_INLINE sigar_uint64_t get_named_proc_token(char *buffer,
                             ^
linux_sigar.c:793:75: warning: passing argument 2 of 'get_named_proc_token' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     proc_cumulative_disk_io->bytes_written = get_named_proc_token(buffer, "\nwrite_bytes");
                                                                           ^
linux_sigar.c:771:29: note: expected 'char *' but argument is of type 'const char *'
 SIGAR_INLINE sigar_uint64_t get_named_proc_token(char *buffer,
                             ^
linux_sigar.c: In function 'sigar_disk_usage_get':
linux_sigar.c:1462:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if (disk->time == SIGAR_FIELD_NOTIMPL) {
                        ^
linux_sigar.c:1466:36: error: 'HZ' undeclared (first use in this function)
             tput = ((double)ios) * HZ / interval;
                                    ^
linux_sigar.c:1466:36: note: each undeclared identifier is reported only once for each function it appears in
linux_sigar.c:1470:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if (disk->qtime == SIGAR_FIELD_NOTIMPL) {
                         ^
In file included from linux_sigar.c:30:0:
linux_sigar.c: In function 'sigar_cpu_info_list_get':
../../include/sigar_util.h:147:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     (sigar->ncpu < sigar->lcpu) ? sigar->ncpu : \
                  ^
linux_sigar.c:1675:31: note: in expansion of macro 'sigar_cpu_socket_count'
         info->total_sockets = sigar_cpu_socket_count(sigar);
                               ^
linux_sigar.c: In function 'sigar_nfs_v2_get':
linux_sigar.c:2251:29: warning: passing argument 2 of 'sigar_proc_nfs_gets' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
                             "proc2", buffer, sizeof(buffer));
                             ^
linux_sigar.c:2223:12: note: expected 'char *' but argument is of type 'const char *'
 static int sigar_proc_nfs_gets(char *file, char *tok,
            ^
In file included from linux_sigar.c:30:0:
linux_sigar.c: In function 'sigar_nfs_client_v2_get':
../../include/sigar_util.h:60:22: warning: passing argument 1 of 'sigar_nfs_v2_get' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 #define PROC_FS_ROOT "/proc/"
                      ^
linux_sigar.c:2284:29: note: in expansion of macro 'PROC_FS_ROOT'
     return sigar_nfs_v2_get(PROC_FS_ROOT "net/rpc/nfs",
                             ^
linux_sigar.c:2246:12: note: expected 'char *' but argument is of type 'const char *'
 static int sigar_nfs_v2_get(char *file, sigar_nfs_v2_t *nfs)
            ^
In file included from linux_sigar.c:30:0:
linux_sigar.c: In function 'sigar_nfs_server_v2_get':
../../include/sigar_util.h:60:22: warning: passing argument 1 of 'sigar_nfs_v2_get' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 #define PROC_FS_ROOT "/proc/"
                      ^
linux_sigar.c:2291:29: note: in expansion of macro 'PROC_FS_ROOT'
     return sigar_nfs_v2_get(PROC_FS_ROOT "net/rpc/nfsd",
                             ^
linux_sigar.c:2246:12: note: expected 'char *' but argument is of type 'const char *'
 static int sigar_nfs_v2_get(char *file, sigar_nfs_v2_t *nfs)
            ^
linux_sigar.c: In function 'sigar_nfs_v3_get':
linux_sigar.c:2300:29: warning: passing argument 2 of 'sigar_proc_nfs_gets' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
                             "proc3", buffer, sizeof(buffer));
                             ^
linux_sigar.c:2223:12: note: expected 'char *' but argument is of type 'const char *'
 static int sigar_proc_nfs_gets(char *file, char *tok,
            ^
In file included from linux_sigar.c:30:0:
linux_sigar.c: In function 'sigar_nfs_client_v3_get':
../../include/sigar_util.h:60:22: warning: passing argument 1 of 'sigar_nfs_v3_get' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 #define PROC_FS_ROOT "/proc/"
                      ^
linux_sigar.c:2337:29: note: in expansion of macro 'PROC_FS_ROOT'
     return sigar_nfs_v3_get(PROC_FS_ROOT "net/rpc/nfs",
                             ^
linux_sigar.c:2295:12: note: expected 'char *' but argument is of type 'const char *'
 static int sigar_nfs_v3_get(char *file, sigar_nfs_v3_t *nfs)
            ^
In file included from linux_sigar.c:30:0:
linux_sigar.c: In function 'sigar_nfs_server_v3_get':
../../include/sigar_util.h:60:22: warning: passing argument 1 of 'sigar_nfs_v3_get' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 #define PROC_FS_ROOT "/proc/"
                      ^
linux_sigar.c:2344:29: note: in expansion of macro 'PROC_FS_ROOT'
     return sigar_nfs_v3_get(PROC_FS_ROOT "net/rpc/nfsd",
                             ^
linux_sigar.c:2295:12: note: expected 'char *' but argument is of type 'const char *'
 static int sigar_nfs_v3_get(char *file, sigar_nfs_v3_t *nfs)
            ^
linux_sigar.c: In function 'get_hw_type':
linux_sigar.c:2354:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "ax25";
                ^
linux_sigar.c:2356:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "ec";
                ^
linux_sigar.c:2358:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "ether";
                ^
linux_sigar.c:2360:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "fddi";
                ^
linux_sigar.c:2362:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "dlci";
                ^
linux_sigar.c:2364:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "frad";
                ^
linux_sigar.c:2366:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "hdlc";
                ^
linux_sigar.c:2368:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "lapb";
                ^
linux_sigar.c:2370:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "hippi";
                ^
linux_sigar.c:2372:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "irda";
                ^
linux_sigar.c:2374:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "loop";
                ^
linux_sigar.c:2376:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "netrom";
                ^
linux_sigar.c:2378:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "ppp";
                ^
linux_sigar.c:2380:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "rose";
                ^
linux_sigar.c:2382:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "sit";
                ^
linux_sigar.c:2384:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "slip";
                ^
linux_sigar.c:2386:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "cslip";
                ^
linux_sigar.c:2388:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "slip6";
                ^
linux_sigar.c:2390:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "cslip6";
                ^
linux_sigar.c:2392:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "adaptive";
                ^
linux_sigar.c:2394:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "tr";
                ^
linux_sigar.c:2396:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "tr";
                ^
linux_sigar.c:2398:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "tunnel";
                ^
linux_sigar.c:2400:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "x25";
                ^
linux_sigar.c:2402:16: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         return "unknown";
                ^
linux_sigar.c: In function 'generic_vendor_parse':
linux_sigar.c:2605:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             if (len > sizeof(info->vendor_version)) {
                     ^
In file included from linux_sigar.c:30:0:
linux_sigar.c: At top level:
../../include/sigar_util.h:82:20: warning: inline function 'sigar_skip_multiple_token' declared but never defined
 SIGAR_INLINE char *sigar_skip_multiple_token(char *p, int count);
                    ^
../../include/sigar_util.h:80:20: warning: inline function 'sigar_skip_token' declared but never defined
 SIGAR_INLINE char *sigar_skip_token(char *p);
                    ^
../../include/sigar_util.h:78:20: warning: inline function 'sigar_skip_line' declared but never defined
 SIGAR_INLINE char *sigar_skip_line(char *buffer, int buflen);
                    ^
Makefile:238: recipe for target 'linux_sigar.o' failed
make: *** [linux_sigar.o] Error 1

make failed, exit code 2

Gem files will remain installed in /usr/local/bundle/gems/sigar-0.7.3 for inspection.
Results logged to /usr/local/bundle/extensions/x86_64-linux/2.3.0-static/sigar-0.7.3/gem_make.out
@ncopa

This comment has been minimized.

ncopa commented Mar 14, 2016

The HZ define is a part of kernel and is not exposed by musl libc.

To fix that, use: ncopa@5e09cdb or possiblly do #include <asm-generic/param.h>

But even if it will build with that patch it will likely crash due to bad use of the nasty strerror_r. You need ncopa@e78f794 too.

I don't know how to inject patches when building with gem though.

@jodok

This comment has been minimized.

jodok commented Mar 21, 2016

+1

@AlexYaruki

This comment has been minimized.

AlexYaruki commented Sep 2, 2016

+1, Similar problem on Ubuntu 16.04 64-bit when building with CMake:

../build-src/libsigar.so: undefined reference to 'sigar_skip_token'
../build-src/libsigar.so: undefined reference to 'get_named_proc_token'
../build-src/libsigar.so: undefined reference to 'sigar_skip_multiple_token'

@AlexYaruki

This comment has been minimized.

AlexYaruki commented Sep 2, 2016

Created small patch to fix undefined reference to inlined functions: #90

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment