Commit 12a2d054 by Alexis Hetu Committed by Alexis Hétu

Fixing the Linux build without breaking the Mac build

This change adds 2 platform specific files for Linux, which are used to define the typeinfo() functions used in some classes in order to satisfy the ubsan compiler on Linux. Unfortunately, adding those definitions on all platforms breaks the build on Mac. Those aren't necessary on Windows, so the Linux specific files are enough to make the build work properly on all platforms. Change-Id: If731ab2e5df47731695412da04f9b2db576ea140 Reviewed-on: https://swiftshader-review.googlesource.com/8768Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent 147f6686
......@@ -69,7 +69,10 @@ shared_library("swiftshader_libEGL") {
configs -= [ "//build/config/win:unicode" ]
ldflags = [ "/DEF:" + rebase_path("libGLESv2.def", root_build_dir) ]
} else if (is_linux) {
sources += [ "../../Main/libX11.cpp" ]
sources += [
"../../Main/libX11.cpp",
"TypeInfo.cpp",
]
ldflags =
[ "-Wl,--version-script=" + rebase_path("exports.map", root_build_dir) ]
}
......
// Copyright 2017 The SwiftShader Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "common/Image.hpp"
#include "Main/FrameBuffer.hpp"
#include "Renderer/Surface.hpp"
namespace sw
{
void FrameBuffer::typeinfo() {}
void Surface::typeinfo() {}
}
namespace egl
{
void Image::typeinfo() {}
}
......@@ -89,6 +89,7 @@ shared_library("swiftshader_libGLESv2") {
configs -= [ "//build/config/win:unicode" ]
ldflags = [ "/DEF:" + rebase_path("libGLESv2.def", root_build_dir) ]
} else if (is_linux) {
sources += [ "TypeInfo.cpp" ]
ldflags =
[ "-Wl,--version-script=" + rebase_path("exports.map", root_build_dir) ]
}
......
// Copyright 2017 The SwiftShader Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "libEGL/Display.h"
#include "libEGL/EGLSurface.h"
namespace egl
{
void Surface::typeinfo() {}
void Display::typeinfo() {}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment