Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 418137 - sys-devel/clang-3.1-r2 fails to generate executables when passed -Wa,--noexecstack
Summary: sys-devel/clang-3.1-r2 fails to generate executables when passed -Wa,--noexec...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All All
: Normal enhancement with 1 vote (vote)
Assignee: Michał Górny
URL:
Whiteboard:
Keywords: NeedPatch
Depends on:
Blocks: systemwide-clang 417795
  Show dependency tree
 
Reported: 2012-05-29 13:46 UTC by Richard Yao (RETIRED)
Modified: 2016-08-16 16:34 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
dev-libs/openssl-1.0.1c failure build.log (build.log,23.28 KB, text/plain)
2012-05-29 13:46 UTC, Richard Yao (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Yao (RETIRED) gentoo-dev 2012-05-29 13:46:36 UTC
Created attachment 313527 [details]
dev-libs/openssl-1.0.1c failure build.log

The ebuild for dev-libs/openssl explicitly does `append-flags $(test-flags-CC -Wa,--noexecstack)`, which causes a build failure when the patch from bug #417795 is applied. Without that patch, a failure occurs before clang is invoked.

It would be useful to silently ignore this flag until support for stack smashing protection is implemented in Clang.
Comment 1 Richard Yao (RETIRED) gentoo-dev 2012-05-29 13:49:17 UTC
Actually, this failure was caused by the use of -Wall, which is a separate issue.
Comment 2 Richard Yao (RETIRED) gentoo-dev 2012-05-29 14:02:20 UTC
I was wrong to think that -Wall was causing this. It happens regardless of whether or not -Wall is present. :/
Comment 3 Alexis Ballier gentoo-dev 2012-05-29 21:04:45 UTC
you should probably provide the exact command line and the output of clang -v

it works fine here:

$ cat foo.c 
#include <stdio.h>
int main() {
        printf("hello\n");
    }

$ clang -Wa,--noexecstack foo.c
$ ./a.out 
hello
Comment 4 Richard Yao (RETIRED) gentoo-dev 2012-05-30 01:55:02 UTC
I can reproduce this on my system by running the following (with the patch from bug #417795 applied by epatch_user):

`env CC=clang emerge -1v openssl && (cd /var/tmp/portage/dev-libs/openssl-1.0.1c/work/openssl-1.0.1c/crypto &&../util/domd .. -MD clang -- -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -pthread -D_THREAD_SAFE -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN -DTERMIOS -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -O2 -pipe -march=amdfam10 -mtune=amdfam10 -fno-strict-aliasing -Wa,--noexecstack -I. -I.. -I../include -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_STORE -- cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c cpt_err.c ebcdic.c uid.c o_time.c o_str.c o_dir.c o_fips.c o_init.c fips_ers.c)`

I have had trouble isolating the exact command that is being invoked with truss, so I do not know what that is at the moment.
Comment 5 Valeriy Malov 2016-02-20 19:40:26 UTC
Is this still an issue? openssl-1.0.2f builds fine since the bug #417795 was fixed
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-08-16 16:34:27 UTC
Mass-closing of bugs pinned to old clang versions. Please reopen and update summary appropriately if the bug still applies to a newer version (and hasn't been reported separately for it).