#25319 closed defect (fixed)

commit 4438ef32 breaks tor macOS cross builds

Reported by: gk Owned by: nickm
Priority: Medium Milestone: Tor: 0.3.4.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: macos
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

The macOS cross build we do for Tor Browser is broken after removing a bunch of redundant #includes (i.e. 4438ef3288256e1f1ba706c157206a2ac190781d):

  CC       src/test/src_test_test-test_address_set.o
In file included from src/test/test_address.c:15:
/var/tmp/dist/macosx-toolchain/SDK//usr/include/net/if.h:300:19: error: field has incomplete type 'struct sockaddr'
                struct  sockaddr ifru_addr;
                                 ^
/var/tmp/dist/macosx-toolchain/SDK//usr/include/net/if.h:300:10: note: forward declaration of 'struct sockaddr'
                struct  sockaddr ifru_addr;
                        ^
/var/tmp/dist/macosx-toolchain/SDK//usr/include/net/if.h:301:19: error: field has incomplete type 'struct sockaddr'
                struct  sockaddr ifru_dstaddr;
                                 ^
/var/tmp/dist/macosx-toolchain/SDK//usr/include/net/if.h:300:10: note: forward declaration of 'struct sockaddr'
                struct  sockaddr ifru_addr;
                        ^
/var/tmp/dist/macosx-toolchain/SDK//usr/include/net/if.h:302:19: error: field has incomplete type 'struct sockaddr'
                struct  sockaddr ifru_broadaddr;
                                 ^
/var/tmp/dist/macosx-toolchain/SDK//usr/include/net/if.h:300:10: note: forward declaration of 'struct sockaddr'
                struct  sockaddr ifru_addr;
                        ^
/var/tmp/dist/macosx-toolchain/SDK//usr/include/net/if.h:346:18: error: field has incomplete type 'struct sockaddr'
        struct  sockaddr ifra_addr;
                         ^
/var/tmp/dist/macosx-toolchain/SDK//usr/include/net/if.h:300:10: note: forward declaration of 'struct sockaddr'
                struct  sockaddr ifru_addr;
                        ^
/var/tmp/dist/macosx-toolchain/SDK//usr/include/net/if.h:347:18: error: field has incomplete type 'struct sockaddr'
        struct  sockaddr ifra_broadaddr;
                         ^
/var/tmp/dist/macosx-toolchain/SDK//usr/include/net/if.h:300:10: note: forward declaration of 'struct sockaddr'
                struct  sockaddr ifru_addr;
                        ^
/var/tmp/dist/macosx-toolchain/SDK//usr/include/net/if.h:348:18: error: field has incomplete type 'struct sockaddr'
        struct  sockaddr ifra_mask;
                         ^
/var/tmp/dist/macosx-toolchain/SDK//usr/include/net/if.h:300:10: note: forward declaration of 'struct sockaddr'
                struct  sockaddr ifru_addr;
                        ^
/var/tmp/dist/macosx-toolchain/SDK//usr/include/net/if.h:431:26: error: field has incomplete type 'struct sockaddr_storage'
        struct sockaddr_storage addr;   /* in/out */
                                ^
/var/tmp/dist/macosx-toolchain/SDK//usr/include/net/if.h:431:9: note: forward declaration of 'struct sockaddr_storage'
        struct sockaddr_storage addr;   /* in/out */
               ^
/var/tmp/dist/macosx-toolchain/SDK//usr/include/net/if.h:432:26: error: field has incomplete type 'struct sockaddr_storage'
        struct sockaddr_storage dstaddr; /* out */
                                ^
/var/tmp/dist/macosx-toolchain/SDK//usr/include/net/if.h:431:9: note: forward declaration of 'struct sockaddr_storage'
        struct sockaddr_storage addr;   /* in/out */
               ^
8 errors generated.
Makefile:9761: recipe for target 'src/test/src_test_test-test_address.o' failed
make[1]: *** [src/test/src_test_test-test_address.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/var/tmp/build/tor-master'
make: *** [all] Error 2
Makefile:3394: recipe for target 'all' failed

Child Tickets

Change History (3)

comment:1 Changed 17 months ago by teor

Keywords: macos added
Summary: commit 4438ef3288256e1f1ba706c157206a2ac190781d breaks tor macOS cross buildscommit 4438ef32 breaks tor macOS cross builds

There is no ticket for this commit.

Maybe there is a bug in our configure header detection, or maybe the headers really do need to be included in that order.

The compat.c change may also be problematic, because it's conditional on APPLE.

comment:2 Changed 17 months ago by nickm

Owner: set to nickm
Status: newaccepted

comment:3 Changed 17 months ago by nickm

Resolution: fixed
Status: acceptedclosed

Fixed by reverting the test_address.c change in fc22bcadb51bcabb9b9c16a9768adbe86788b7f1. I've tested it on my osx laptop, and it works for me. Then again, the old version also worked for me: apparently this behavior is not present in all versions of the mac headers.

Note: See TracTickets for help on using tickets.