Reapply r234378, with test fixed (by emaste).

Hopefully this time the build won't be broken.

llvm-svn: 234553
This commit is contained in:
Davide Italiano 2015-04-10 01:40:25 +00:00
parent ab5d90568e
commit b63c9c32dc
2 changed files with 7 additions and 3 deletions

View File

@ -24,7 +24,7 @@ LinkingContext::LinkingContext()
_warnIfCoalesableAtomsHaveDifferentCanBeNull(false),
_warnIfCoalesableAtomsHaveDifferentLoadName(false),
_printRemainingUndefines(true), _allowRemainingUndefines(false),
_logInputFiles(false), _allowShlibUndefines(false),
_logInputFiles(false), _allowShlibUndefines(true),
_outputFileType(OutputFileType::Default), _nextOrdinal(0) {}
LinkingContext::~LinkingContext() {}

View File

@ -3,14 +3,18 @@
# to create an executable and a shared library
#
# This test will fail because there are unresolved symbols from the shared
# library and we are not passing --allow-shlib-undefined
# library and we are passing --no-allow-shlib-undefined
RUN: not lld -flavor gnu -target x86_64-linux %p/Inputs/tls.x86-64 \
RUN: %p/Inputs/shared.so-x86-64 -o %t -e main 2> %t1
RUN: %p/Inputs/shared.so-x86-64 -o %t -e main --no-allow-shlib-undefined 2> %t1
RUN: FileCheck -check-prefix=EXEC %s < %t1
# This test will pass because of --allow-shlib-undefined
RUN: lld -flavor gnu -target x86_64-linux %p/Inputs/tls.x86-64 \
RUN: %p/Inputs/shared.so-x86-64 -o %t -e main --allow-shlib-undefined \
RUN: --defsym=__tls_get_addr=0
# This test will pass becase --allow-shlib-undefined is the default.
RUN: lld -flavor gnu -target x86_64-linux %p/Inputs/tls.x86-64 \
RUN: %p/Inputs/shared.so-x86-64 -o %t -e main \
RUN: --defsym=__tls_get_addr=0
# Building shared libraries should not fail when there is a undefined symbol.
# Test creation of shared library, this should pass because we are using
# shared option and by default, dynamic library wouldn't create undefined atoms