Project

General

Profile

Bug #3230

configure: linux/if.h: present but cannot be compiled

Added by fixeria over 1 year ago. Updated 4 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
05/03/2018
Due date:
% Done:

100%

Spec Reference:

Description

checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking linux/if.h usability... no
checking linux/if.h presence... yes

configure: WARNING: linux/if.h: present but cannot be compiled
configure: WARNING: linux/if.h:     check for missing prerequisite headers?
configure: WARNING: linux/if.h: see the Autoconf documentation
configure: WARNING: linux/if.h:     section "Present But Cannot Be Compiled" 
configure: WARNING: linux/if.h: proceeding with the compiler's result
configure: WARNING:     ## ------------------------------------------------- ##
configure: WARNING:     ## Report this to osmocom-net-gprs@lists.osmocom.org ##
configure: WARNING:     ## ------------------------------------------------- ##

checking for linux/if.h... no
checking net/if.h usability... yes
checking net/if.h presence... yes
checking for net/if.h... yes
checking linux/if_tun.h usability... yes
checking linux/if_tun.h presence... yes
checking for linux/if_tun.h... yes
checking net/if_tun.h usability... no
checking net/if_tun.h presence... no
checking for net/if_tun.h... no
checking linux/netlink.h usability... yes
checking linux/netlink.h presence... yes
checking for linux/netlink.h... yes
checking linux/rtnetlink.h usability... yes
checking linux/rtnetlink.h presence... yes
checking for linux/rtnetlink.h... yes
checking for an ANSI C-conforming const... yes
checking for mode_t... yes
checking for size_t... yes

...

Anyone else can confirm this? If no, I'll share some more details about my OS.
Asking because I don't see such messages during compilation of other osmo-*.

config.log config.log 43.8 KB fixeria, 05/03/2018 04:03 PM

History

#2 Updated by fixeria over 1 year ago

Ok, would be better to upload all together.

#3 Updated by fixeria about 1 year ago

$ autoconf -Wall
configure.ac:4: warning: 'AM_CONFIG_HEADER': this macro is obsolete.
configure.ac:4: You should use the 'AC_CONFIG_HEADERS' macro instead.
aclocal.m4:904: AM_CONFIG_HEADER is expanded from...
configure.ac:4: the top level
configure.ac:11: warning: The macro `AC_CANONICAL_SYSTEM' is obsolete.
configure.ac:11: You should run autoupdate.
../../lib/autoconf/general.m4:1857: AC_CANONICAL_SYSTEM is expanded from...
configure.ac:11: the top level

#4 Updated by pespin 4 months ago

Quick investigation:

fixeria do you still get those "WARNING: linux/if.h" lines nowadays with current master?

#5 Updated by pespin 4 months ago

Full log, interesting part:

configure:11513: checking linux/if.h usability
configure:11513: gcc -c -g -O2  conftest.c >&5
In file included from conftest.c:67:0:
/usr/include/linux/if.h:185:19: error: field 'ifru_addr' has incomplete type
   struct sockaddr ifru_addr;
                   ^
/usr/include/linux/if.h:186:19: error: field 'ifru_dstaddr' has incomplete type
   struct sockaddr ifru_dstaddr;
                   ^
/usr/include/linux/if.h:187:19: error: field 'ifru_broadaddr' has incomplete type
   struct sockaddr ifru_broadaddr;
                   ^
/usr/include/linux/if.h:188:19: error: field 'ifru_netmask' has incomplete type
   struct sockaddr ifru_netmask;
                   ^
/usr/include/linux/if.h:189:20: error: field 'ifru_hwaddr' has incomplete type
   struct  sockaddr ifru_hwaddr;
                    ^
configure:11513: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "osmo-ggsn" 
| #define PACKAGE_TARNAME "osmo-ggsn" 
| #define PACKAGE_VERSION "1.2.0" 
| #define PACKAGE_STRING "osmo-ggsn 1.2.0" 
| #define PACKAGE_BUGREPORT "osmocom-net-gprs@lists.osmocom.org" 
| #define PACKAGE_URL "" 
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/" 
| #define STDC_HEADERS 1
| #define HAVE_SYS_WAIT_H 1
| #define HAVE_ARPA_INET_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_NETDB_H 1
| #define HAVE_NETINET_IN_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_SYS_IOCTL_H 1
| #define HAVE_SYS_SOCKET_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h.  */
| #include <stdio.h>
| #ifdef HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #ifdef HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #ifdef STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # ifdef HAVE_STDLIB_H
| #  include <stdlib.h>
| # endif
| #endif
| #ifdef HAVE_STRING_H
| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
| #  include <memory.h>
| # endif
| # include <string.h>
| #endif
| #ifdef HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #ifdef HAVE_INTTYPES_H
| # include <inttypes.h>
| #endif
| #ifdef HAVE_STDINT_H
| # include <stdint.h>
| #endif
| #ifdef HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| #include <linux/if.h>
configure:11513: result: no
configure:11513: checking linux/if.h presence
configure:11513: gcc -E  conftest.c
configure:11513: $? = 0
configure:11513: result: yes
configure:11513: WARNING: linux/if.h: present but cannot be compiled
configure:11513: WARNING: linux/if.h:     check for missing prerequisite headers?
configure:11513: WARNING: linux/if.h: see the Autoconf documentation
configure:11513: WARNING: linux/if.h:     section "Present But Cannot Be Compiled" 
configure:11513: WARNING: linux/if.h: proceeding with the compiler's result

There seems to be a similar issue with net/if_tun.h.

Related: https://algorithmicallyrandom.blogspot.com/2012/07/error-on-including-include.html

#6 Updated by pespin 4 months ago

  • Status changed from New to Feedback
  • Assignee set to fixeria
  • % Done changed from 0 to 50

fixeria can you give a try with and without this patch applied to see if it fixes the issue? Otherwise please provide again logs with/without the patch applied.

https://gerrit.osmocom.org/c/osmo-ggsn/+/14624 configure.ac: Workaround some linux/if.h headers requiring external ...

#7 Updated by fixeria 4 months ago

  • % Done changed from 50 to 80

I just tested your change, and I don't see the warnings on my ancient Ubuntu anymore:

...
checking for linux/if.h... yes
checking for net/if.h... yes
checking linux/if_tun.h usability... yes
checking linux/if_tun.h presence... yes
checking for linux/if_tun.h... yes
checking net/if_tun.h usability... no
checking net/if_tun.h presence... no
checking for net/if_tun.h... no
checking linux/netlink.h usability... yes
checking linux/netlink.h presence... yes
checking for linux/netlink.h... yes
checking linux/rtnetlink.h usability... yes
checking linux/rtnetlink.h presence... yes
checking for linux/rtnetlink.h... yes
checking for an ANSI C-conforming const... yes
...

#8 Updated by pespin 4 months ago

  • Assignee changed from fixeria to pespin

#9 Updated by pespin 4 months ago

  • Status changed from Feedback to Resolved
  • % Done changed from 80 to 100

Merged, closing.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)