Skip to content
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

gcc6: fix building upx #1360

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/upx.mk
Expand Up @@ -47,7 +47,9 @@ define $(PKG)_BUILD_$(BUILD)
'CC=$(BUILD_CC)' \
'PKG_CONFIG=$(PREFIX)/$(BUILD)/bin/pkgconf' \
'LIBS=-L$(PREFIX)/$(BUILD)/lib -lucl -lz' \
$(shell [ `uname -s` == Darwin ] && echo "CXXFLAGS='-Wno-error=unused-local-typedef'") \
$(shell [ `uname -s` == Darwin ] && \
echo "CXXFLAGS=-Wno-error=unused-local-typedefs -Wno-error=misleading-indentation" || \
echo "CXXFLAGS=-Wno-error=misleading-indentation") \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Tony, This seems to have a side effect. Using gcc (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609:

g++ -DWITH_LZMA=0x920 -I/home/brand/projects/mxe/mxe/tmp-upx-x86_64-unknown-linux-gnu/upx-3.91-src/ucl-1.03/include -I/home/brand/projects/mxe/mxe/tmp-upx-x86_64-unknown-linux-gnu/upx-3.91-src/lzma -Wno-error=misleading-indentation -o c_file.o -c c_file.cpp
cc1plus: error: -Werror=misleading-indentation: no option -Wmisleading-indentation

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, my apologies. I think we should just use -Wno-error for this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see now, couldn't actually see either the original error with gcc6 on Darwin as setting CXXFLAGS to anything disables the -Werror set by upx. The second option -Wno-error=misleading-indentation isn't quoted correctly and is passed an option to make instead of CXXFLAGS so didn't affect gcc5.

I'm pretty sure this fix (along with some other related changes in #1496) will work across all platforms.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mabrand #1496 is merged.

'exeext='
cp '$(1)/src/upx' '$(PREFIX)/$(BUILD)/bin/'
endef