Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit99c51d5

Browse files
committed
Select CFLAGS_SL at configure time, not in platform-specific Makefiles.
Move the platform-dependent logic that sets CFLAGS_SL fromsrc/makefiles/Makefile.foo to src/template/foo, so that the valueis determined at configure time and thus is available while runningconfigure's tests.On a couple of platforms this might save a few microseconds of buildtime by eliminating a test that make otherwise has to do over and over.Otherwise it's pretty much a wash for build purposes; in particular,this makes no difference to anyone who might be overriding CFLAGS_SLvia a make option.This patch in itself does nothing with the value and thus should notchange any behavior, though you'll probably have to re-run configureto get a correctly updated Makefile.global. We'll use the newconfigure variable in a follow-on patch.Per gripe from Kyotaro Horiguchi. Back-patch to all supported branches,because the follow-on patch is a portability bug fix.Discussion:https://postgr.es/m/20191010.144533.263180400.horikyota.ntt@gmail.com
1 parentaf4477b commit99c51d5

21 files changed

+55
-26
lines changed

‎configure

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,7 @@ autodepend
729729
TAS
730730
GCC
731731
CPP
732+
CFLAGS_SL
732733
BITCODE_CXXFLAGS
733734
BITCODE_CFLAGS
734735
CFLAGS_VECTOR
@@ -6368,7 +6369,6 @@ fi
63686369

63696370
fi
63706371

6371-
CFLAGS_VECTOR=$CFLAGS_VECTOR
63726372

63736373

63746374
# Determine flags used to emit bitcode for JIT inlining. Need to test
@@ -6688,9 +6688,10 @@ CXXFLAGS="$CXXFLAGS $user_CXXFLAGS"
66886688
BITCODE_CFLAGS="$BITCODE_CFLAGS $user_BITCODE_CFLAGS"
66896689
BITCODE_CXXFLAGS="$BITCODE_CXXFLAGS $user_BITCODE_CXXFLAGS"
66906690

6691-
BITCODE_CFLAGS=$BITCODE_CFLAGS
66926691

6693-
BITCODE_CXXFLAGS=$BITCODE_CXXFLAGS
6692+
6693+
6694+
# The template file must set up CFLAGS_SL; we don't support user override
66946695

66956696

66966697
# Check if the compiler still works with the final flag settings

‎configure.in

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ elif test "$PORTNAME" = "hpux"; then
536536
PGAC_PROG_CXX_CFLAGS_OPT([+Olibmerrno])
537537
fi
538538

539-
AC_SUBST(CFLAGS_VECTOR, $CFLAGS_VECTOR)
539+
AC_SUBST(CFLAGS_VECTOR)
540540

541541
# Determine flags used to emit bitcode for JIT inlining. Need to test
542542
# for behaviour changing compiler flags, to keep compatibility with
@@ -596,8 +596,11 @@ CXXFLAGS="$CXXFLAGS $user_CXXFLAGS"
596596
BITCODE_CFLAGS="$BITCODE_CFLAGS $user_BITCODE_CFLAGS"
597597
BITCODE_CXXFLAGS="$BITCODE_CXXFLAGS $user_BITCODE_CXXFLAGS"
598598

599-
AC_SUBST(BITCODE_CFLAGS, $BITCODE_CFLAGS)
600-
AC_SUBST(BITCODE_CXXFLAGS, $BITCODE_CXXFLAGS)
599+
AC_SUBST(BITCODE_CFLAGS)
600+
AC_SUBST(BITCODE_CXXFLAGS)
601+
602+
# The template file must set up CFLAGS_SL; we don't support user override
603+
AC_SUBST(CFLAGS_SL)
601604

602605
# Check if the compiler still works with the final flag settings
603606
# (note, we're not checking that for CXX, which is optional)

‎src/Makefile.global.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ GCC = @GCC@
259259
SUN_STUDIO_CC = @SUN_STUDIO_CC@
260260
CXX = @CXX@
261261
CFLAGS = @CFLAGS@
262+
CFLAGS_SL = @CFLAGS_SL@
262263
CFLAGS_VECTOR = @CFLAGS_VECTOR@
263264
CFLAGS_SSE42 = @CFLAGS_SSE42@
264265
CFLAGS_ARMV8_CRC32C = @CFLAGS_ARMV8_CRC32C@

‎src/makefiles/Makefile.cygwin

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ LIBS:=$(filter-out -lm -lc, $(LIBS))
1212

1313
AROPT = crs
1414
DLSUFFIX = .dll
15-
CFLAGS_SL =
1615

1716
override CPPFLAGS += -DWIN32_STACK_RLIMIT=$(WIN32_STACK_RLIMIT)
1817

‎src/makefiles/Makefile.freebsd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ endif
77

88
DLSUFFIX = .so
99

10-
CFLAGS_SL = -fPIC -DPIC
11-
1210
# extra stuff for $(with_temp_install)
1311
# we need this to get LD_LIBRARY_PATH searched ahead of the compiled-in
1412
# rpath, if no DT_RUNPATH is present in the executable. The conditions

‎src/makefiles/Makefile.hpux

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ ifeq ($(host_cpu), ia64)
3030
else
3131
DLSUFFIX = .sl
3232
endif
33-
ifeq ($(GCC), yes)
34-
CFLAGS_SL = -fPIC
35-
else
36-
CFLAGS_SL = +Z
37-
endif
3833

3934
# env var name to use in place of LD_LIBRARY_PATH
4035
ld_library_path_var = SHLIB_PATH

‎src/makefiles/Makefile.linux

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ rpath = -Wl,-rpath,'$(rpathdir)',--enable-new-dtags
77

88
DLSUFFIX = .so
99

10-
CFLAGS_SL = -fPIC
11-
1210

1311
# Rule for building a shared library from a single .o file
1412
%.so: %.o

‎src/makefiles/Makefile.netbsd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ endif
99

1010
DLSUFFIX = .so
1111

12-
CFLAGS_SL = -fPIC -DPIC
13-
1412

1513
# Rule for building a shared library from a single .o file
1614
%.so: %.o

‎src/makefiles/Makefile.openbsd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ endif
77

88
DLSUFFIX = .so
99

10-
CFLAGS_SL = -fPIC -DPIC
11-
1210

1311
# Rule for building a shared library from a single .o file
1412
%.so: %.o

‎src/makefiles/Makefile.solaris

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ rpath = -Wl,-R'$(rpathdir)'
1010
endif
1111

1212
DLSUFFIX = .so
13-
ifeq ($(GCC), yes)
14-
CFLAGS_SL = -fPIC
15-
else
16-
CFLAGS_SL = -KPIC
17-
endif
13+
1814

1915
# Rule for building a shared library from a single .o file
2016
%.so: %.o

‎src/makefiles/Makefile.win32

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ override CPPFLAGS += -DWIN32_STACK_RLIMIT=$(WIN32_STACK_RLIMIT)
1212

1313
AROPT = crs
1414
DLSUFFIX = .dll
15-
CFLAGS_SL =
1615

1716
ifneq (,$(findstring backend,$(subdir)))
1817
ifeq (,$(findstring conversion_procs,$(subdir)))

‎src/template/aix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# src/template/aix
2+
13
# Set default options if using xlc. This formerly included -qsrcmsg, but that
24
# option elicits internal compiler errors from xlc v16.1.0. Note: configure
35
# will add -qnoansialias if the compiler accepts it, even if user specifies a
@@ -17,6 +19,9 @@ if test "$GCC" != yes ; then
1719
FORCE_DISABLE_RESTRICT=yes
1820
fi
1921

22+
# Extra CFLAGS for code that will go into a shared library
23+
CFLAGS_SL=""
24+
2025
# Native memset() is faster, tested on:
2126
# AIX 5.1 and 5.2, XLC 6.0 (IBM's cc)
2227
# AIX 5.3 ML3, gcc 4.0.1

‎src/template/cygwin

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
SRCH_LIB="/usr/local/lib"
44

5+
# Extra CFLAGS for code that will go into a shared library
6+
CFLAGS_SL=""
7+
58
# --allow-multiple-definition is required to link pg_dump because it finds
69
# pg_toupper() etc. in both libpq and pgport
710
# we'd prefer to use --disable-auto-import to match MSVC linking behavior,

‎src/template/darwin

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ if test x"$PG_SYSROOT" != x"" ; then
1616
fi
1717
fi
1818

19+
# Extra CFLAGS for code that will go into a shared library
20+
CFLAGS_SL=""
21+
1922
# Select appropriate semaphore support. Darwin 6.0 (macOS 10.2) and up
2023
# support System V semaphores; before that we have to use named POSIX
2124
# semaphores, which are less good for our purposes because they eat a

‎src/template/freebsd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
if test x"$PREFERRED_SEMAPHORES" = x"" ; then
55
PREFERRED_SEMAPHORES=UNNAMED_POSIX
66
fi
7+
8+
# Extra CFLAGS for code that will go into a shared library
9+
CFLAGS_SL="-fPIC -DPIC"

‎src/template/hpux

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ if test "$GCC" != yes ; then
88
CFLAGS="+O2"
99
fi
1010

11+
# Extra CFLAGS for code that will go into a shared library
12+
if test "$GCC" = yes ; then
13+
CFLAGS_SL="-fPIC"
14+
else
15+
CFLAGS_SL="+Z"
16+
fi
17+
1118
# Pick right test-and-set (TAS) code. We need out-of-line assembler
1219
# when not using gcc.
1320
case $host in

‎src/template/linux

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ fi
88
# Force _GNU_SOURCE on; plperl is broken with Perl 5.8.0 otherwise
99
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
1010

11+
# Extra CFLAGS for code that will go into a shared library
12+
CFLAGS_SL="-fPIC"
13+
1114
# If --enable-profiling is specified, we need -DLINUX_PROFILE
1215
PLATFORM_PROFILE_FLAGS="-DLINUX_PROFILE"
1316

‎src/template/netbsd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
# src/template/netbsd
22
# tools/thread/thread_test must be run
3+
4+
# Extra CFLAGS for code that will go into a shared library
5+
CFLAGS_SL="-fPIC -DPIC"

‎src/template/openbsd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# src/template/openbsd
2+
3+
# Extra CFLAGS for code that will go into a shared library
4+
CFLAGS_SL="-fPIC -DPIC"

‎src/template/solaris

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# src/template/solaris
2+
3+
# Extra CFLAGS for code that will go into a shared library
4+
if test "$GCC" = yes ; then
5+
CFLAGS_SL="-fPIC"
6+
else
7+
CFLAGS_SL="-KPIC"
8+
fi
9+
110
if test "$SUN_STUDIO_CC" = yes ; then
211
CC="$CC -Xa"# relaxed ISO C mode
312
CFLAGS="-v"# -v is like gcc -Wall

‎src/template/win32

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# src/template/win32
22

3+
# Extra CFLAGS for code that will go into a shared library
4+
CFLAGS_SL=""
5+
36
# --allow-multiple-definition is required to link pg_dump because it finds
47
# pg_toupper() etc. in both libpq and pgport
58
# --disable-auto-import is to ensure we get MSVC-like linking behavior

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp