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

Commit16e9487

Browse files
committed
|> The Makefile.shlib changes will have to be discussed with other Linux
|> developers so we are sure it will work on all platforms.The problem with the current settings is that the linker is calleddirectly. This is wrong, it should always be called through thecompilerdriver (the only exception is `ld -r'). This will make sure that thenecessary libraries like libgcc are linked in.But there is still a different problem with the setting of LDFLAGS_ODBC.The psqlodbc module defines the functions _init and _fini which arereserved for the shared library initialisation. These should be changedto constructor functions. Then LDFLAGS_ODBC can be changed to be just`-lm'. Btw, why does it use -Bsymbolic?Andreas Schwab
1 parentd800532 commit16e9487

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

‎src/Makefile.shlib

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Copyright (c) 1998, Regents of the University of California
77
#
88
# IDENTIFICATION
9-
# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.21 2000/06/28 18:29:13 petere Exp $
9+
# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.22 2000/07/07 01:23:43 momjian Exp $
1010
#
1111
#-------------------------------------------------------------------------
1212

@@ -143,9 +143,9 @@ endif
143143

144144
ifeq ($(PORTNAME), linux)
145145
shlib:= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
146-
LDFLAGS_SL:=-Bdynamic -shared -soname $(shlib)
147-
LDFLAGS_ODBC:= -Bsymbolic -lc -lm
148-
SHLIB_LINK+= -lc
146+
LD:=$(CC)
147+
LDFLAGS_SL:= -shared -Wl,-soname,$(shlib)
148+
LDFLAGS_ODBC:= -lm
149149
CFLAGS+= $(CFLAGS_SL)
150150
endif
151151

‎src/interfaces/odbc/psqlodbc.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333

3434
GLOBAL_VALUESglobals;
3535

36-
BOOL_init(void);
37-
BOOL_fini(void);
3836
RETCODESQL_APISQLDummyOrdinal(void);
3937

4038
#ifdefWIN32
@@ -97,6 +95,20 @@ WSADATA wsaData;
9795
#defineFALSE(BOOL)0
9896
#endif
9997

98+
#ifdef__GNUC__
99+
100+
/* This function is called at library initialization time. */
101+
102+
staticBOOL
103+
__attribute__((constructor))
104+
init(void)
105+
{
106+
getGlobalDefaults(DBMS_NAME,ODBCINST_INI, FALSE);
107+
return TRUE;
108+
}
109+
110+
#else
111+
100112
/* These two functions do shared library initialziation on UNIX, well at least
101113
* on Linux. I don't know about other systems.
102114
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp