Opened 8 years ago

Closed 8 years ago

#50198 closed defect (fixed)

xkbcomp - Compilation failure on OSX 10.11

Reported by: cjones051073 (Chris Jones) Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: Cc:
Port: xkbcomp

Description

OS X 10.11 Xcode 7.2

Build log is attached. Primary error looks like

:info:build xkbcomp.c:228:112: error: result of comparison against a string literal is unspecified (use strncmp instead) [-Werror,-Wstring-compare]
:info:build         if ((argv[i][0] != '-') || (((((argv[i])==((char *)((void*)0))||("-")==((char *)((void*)0)))? (argv[i])!=("-"):strcmp(argv[i],"-"))==((Comparison)0))))
:info:build                                                                                                                ^ ~~~~~
:info:build xkbcomp.c:654:93: error: result of comparison against a string literal is unspecified (use strncmp instead) [-Werror,-Wstring-compare]
:info:build     else if (((((inputFile)==((char *)((void*)0))||("-")==((char *)((void*)0)))? (inputFile)!=("-"):strcmp(inputFile,"-"))==((Comparison)0)))
:info:build                                                                                             ^ ~~~~~
:info:build xkbcomp.c:758:125: error: result of comparison against a string literal is unspecified (use strncmp instead) [-Werror,-Wstring-compare]
:info:build     else if ((!outputFile) && (inputFile) && ((((inputFile)==((char *)((void*)0))||("-")==((char *)((void*)0)))? (inputFile)!=("-"):strcmp(inputFile,"-"))==((Comparison)0)))
:info:build                                                                                                                             ^ ~~~~~
:info:build xkbcomp.c:933:92: error: result of comparison against a string literal is unspecified (use strncmp instead) [-Werror,-Wstring-compare]
:info:build         if (((((inputFile)==((char *)((void*)0))||("-")==((char *)((void*)0)))? (inputFile)!=("-"):strcmp(inputFile,"-"))==((Comparison)0)))
:info:build                                                                                            ^ ~~~~~
:info:build xkbcomp.c:1135:98: error: result of comparison against a string literal is unspecified (use strncmp instead) [-Werror,-Wstring-compare]
:info:build             if (((((outputFile)==((char *)((void*)0))||("-")==((char *)((void*)0)))? (outputFile)!=("-"):strcmp(outputFile,"-"))==((Comparison)0)))
:info:build                                                                                                  ^ ~~~~~
:info:build 5 errors generated.

Possibly a compiler incompatibility ?

Chris

Attachments (3)

main.log (18.8 KB) - added by cjones051073 (Chris Jones) 8 years ago.
main-r144166.log (34.4 KB) - added by cjones051073 (Chris Jones) 8 years ago.
config-leopard-ppc7450.log (9.4 KB) - added by land.apfel@… 8 years ago.
config.log produced by an upgrade on Mac OS X 10.5 on a ppc7450 machine

Download all attachments as: .zip

Change History (11)

Changed 8 years ago by cjones051073 (Chris Jones)

Attachment: main.log added

comment:1 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: jeremyhu@… removed
Owner: changed from macports-tickets@… to jeremyhu@…

comment:2 Changed 8 years ago by jeremyhu (Jeremy Huddleston Sequoia)

That warning should not be causing an error based on the warning flags that I see getting set.

Please attach a new main.log after updating to r144166.

What is the output of /usr/bin/clang --version?

Changed 8 years ago by cjones051073 (Chris Jones)

Attachment: main-r144166.log added

comment:3 Changed 8 years ago by cjones051073 (Chris Jones)

New log attached.

> /usr/bin/clang --version
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.2.0
Thread model: posix

Chris

comment:4 Changed 8 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Odd. I don't see why that's being promoted to an error. It's not becoming an error here nor on the buildbots.

<rdar://problem/24033812>

If you add configure.cflags-append -Wno-string-compare to the Portfile, does it build ok?

comment:5 Changed 8 years ago by cjones051073 (Chris Jones)

Yes, it does build with that option.

There is no buildbot (yet) for OSX10.11, unless I am mistaken ?

Are you sure you are testing the same OSX and Xcode versions as me ? Couldn't this just be just a change in default build flags with the latest clang versions ?

Chris

Last edited 8 years ago by cjones051073 (Chris Jones) (previous) (diff)

comment:6 Changed 8 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: newclosed

Changed 8 years ago by land.apfel@…

Attachment: config-leopard-ppc7450.log added

config.log produced by an upgrade on Mac OS X 10.5 on a ppc7450 machine

comment:7 Changed 8 years ago by land.apfel@…

Resolution: fixed
Status: closedreopened

With r144808 xkbcomp does not compile on Mac OS X 10.5 anymore (probably also 10.4, maybe also later versions of OS X).

$ sudo port -v upgrade xkbcomp
--->  Computing dependencies for xkbcomp.
--->  Configuring xkbcomp
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /opt/local/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for gcc... ccache /usr/bin/gcc-4.2
checking whether the C compiler works... no
configure: error: in `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_x11_xkbcomp/xkbcomp/work/xkbcomp-1.3.1':
configure: error: C compiler cannot create executables
See `config.log' for more details
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_x11_xkbcomp/xkbcomp/work/xkbcomp-1.3.1" && ./configure --prefix=/opt/local --disable-silent-rules
Exit code: 77
Error: Failed to configure xkbcomp, consult /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_x11_xkbcomp/xkbcomp/work/xkbcomp-1.3.1/config.log
Error: org.macports.configure for port xkbcomp returned: configure failure: command execution failed
Warning: targets not executed for xkbcomp: org.macports.install org.macports.configure org.macports.build org.macports.destroot
[...]

In the config.log (attachment:config-leopard-ppc7450.log) it says:

configure:3212: checking whether the C compiler works
configure:3234: ccache /usr/bin/gcc-4.2 -pipe -Os -Wno-string-compare -arch ppc -I/opt/local/include -L/opt/local/lib -Wl,-headerpad_max_install_names -arch ppc conftest.c  >&5
cc1: error: unrecognized command line option "-Wno-string-compare"
configure:3238: $? = 1
configure:3276: result: no

If I remove the lines added by r144808 from my Portfile I can upgrade successfully.

Would it be possible to only add -Wno-string-compare if needed by the compiler?

comment:8 Changed 8 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: reopenedclosed

In the future, please open new tickets for regressions rather than reopening the ticket which caused the regression.

r145322

Note: See TracTickets for help on using tickets.