Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#51711 closed defect (fixed)

libarchive @3.2.1 - Build failure

Reported by: iefdev (Eric F) Owned by: tobypeterson
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: Cc: tobypeterson, erik@…
Port: libarchive

Description

A new version of libarchive(@3.2.1) arrived last night when I ran the update…

But, the build fails. Did try to clean->reinstall etc. I have no idea how to solve this.

Last part of: sudo port -v -s upgrade libarchive (from 1st error)

libarchive/archive_read_support_format_lha.c:1730:3: error: use of unknown builtin '__builtin_bswap16' [-Wimplicit-function-declaration]
                CRC16W;
                ^
libarchive/archive_read_support_format_lha.c:1725:11: note: expanded from macro 'CRC16W'
                        crc ^= bswap16(*buff); buff++;          \
                               ^
libarchive/archive_read_support_format_lha.c:1719:22: note: expanded from macro 'bswap16'
#  define bswap16(x) __builtin_bswap16(x)
                     ^
1 error generated.
make[1]: *** [libarchive/archive_read_support_format_lha.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
libtool: compile:  /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/include -I/opt/local/include/libxml2 -pipe -Os -arch x86_64 -Wall -Wformat -Wformat-security -MT libarchive/archive_read_support_format_mtree.lo -MD -MP -MF libarchive/.deps/archive_read_support_format_mtree.Tpo -c libarchive/archive_read_support_format_mtree.c  -fno-common -DPIC -o libarchive/.libs/archive_read_support_format_mtree.o
libtool: compile:  /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/include -I/opt/local/include/libxml2 -pipe -Os -arch x86_64 -Wall -Wformat -Wformat-security -MT libarchive/archive_read_support_format_iso9660.lo -MD -MP -MF libarchive/.deps/archive_read_support_format_iso9660.Tpo -c libarchive/archive_read_support_format_iso9660.c -o libarchive/archive_read_support_format_iso9660.o >/dev/null 2>&1
libtool: compile:  /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/include -I/opt/local/include/libxml2 -pipe -Os -arch x86_64 -Wall -Wformat -Wformat-security -MT libarchive/archive_read_support_format_cab.lo -MD -MP -MF libarchive/.deps/archive_read_support_format_cab.Tpo -c libarchive/archive_read_support_format_cab.c -o libarchive/archive_read_support_format_cab.o >/dev/null 2>&1
libtool: compile:  /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/include -I/opt/local/include/libxml2 -pipe -Os -arch x86_64 -Wall -Wformat -Wformat-security -MT libarchive/archive_read_support_format_mtree.lo -MD -MP -MF libarchive/.deps/archive_read_support_format_mtree.Tpo -c libarchive/archive_read_support_format_mtree.c -o libarchive/archive_read_support_format_mtree.o >/dev/null 2>&1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_libarchive/libarchive/work/libarchive-3.2.1'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_libarchive/libarchive/work/libarchive-3.2.1'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_libarchive/libarchive/work/libarchive-3.2.1" && /usr/bin/make -j5 -w all 
Exit code: 2
Error: org.macports.build for port libarchive returned: command execution failed
Warning: targets not executed for libarchive: org.macports.install org.macports.build org.macports.destroot
Please see the log file for port libarchive for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_libarchive/libarchive/main.log
Error: Unable to upgrade port: 1
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
 ::  code: 1

[Me@hostname] ~$

Attaching the **/main.log

 

Current working:

$ port echo outdated
libarchive                     @3.1.2_2

OS X: 10.7.5, MacPorts: 2.3.4, Xcode: 4.4.3

Attachments (2)

main.log (111.2 KB) - added by iEFdev 8 years ago.
The logfile for libarchive.
cc_test.txt (13.4 KB) - added by iEFdev 8 years ago.
Terminal output of cc

Download all attachments as: .zip

Change History (12)

Changed 8 years ago by iEFdev

Attachment: main.log added

The logfile for libarchive.

comment:1 Changed 8 years ago by tobypeterson

OS X: 10.7.5, MacPorts: 2.3.4, Xcode: 4.4.3

Uhhhhhh

comment:2 Changed 8 years ago by tobypeterson

Here's the check, which is apparently wrong for your compiler:

#if defined(_MSC_VER) && _MSC_VER >= 1400  /* Visual Studio */
#  define bswap16(x) _byteswap_ushort(x)
#elif (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 8) \
      || defined(__clang__)
#  define bswap16(x) __builtin_bswap16(x)
#else
#  define bswap16(x) ((((x) >> 8) & 0xff) | ((x) << 8))
#endif

If you can provide the output of the following command, I might be able to help:

cc -E -dM -xc /dev/null

comment:3 Changed 8 years ago by tobypeterson

Owner: changed from macports-tickets@… to toby@…

comment:4 Changed 8 years ago by iEFdev

Thanks for you reply…

I have GCC @5.4.0 installed to, so cc alone in Terminal would reflect to that one. And when using sudo port ... it's using the Apple bundled version, right? The error in the first post also list /usr/bin/clang

So, I ran the command on both.

_See attachment “cc_test.txt”_

Changed 8 years ago by iEFdev

Attachment: cc_test.txt added

Terminal output of cc

comment:5 Changed 8 years ago by tobypeterson

So it probably needs a more specific clang version check. I'll try to figure out when builtin_bswap16 was added.

comment:6 Changed 8 years ago by tobypeterson

Or could use has_builtin(builtin_bswap16) if that's supported on that clang version

comment:7 Changed 8 years ago by erik@…

Cc: erik@… added

Cc Me!

Also 10.7.5

Last edited 8 years ago by erik@… (previous) (diff)

comment:8 Changed 8 years ago by tobypeterson

Speculative fix: r149678

comment:9 Changed 8 years ago by tobypeterson

Resolution: fixed
Status: newclosed

comment:10 in reply to:  8 Changed 8 years ago by iEFdev

Replying to toby@…:

Speculative fix: r149678

Thank you! 👍 Installation went fine.

· Eric

Note: See TracTickets for help on using tickets.