Bug 151260 - using $RPM_OPT_FLAGS, can't build emacs cvs
using $RPM_OPT_FLAGS, can't build emacs cvs
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: emacs (Show other bugs)
rawhide
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-03-16 10:02 EST by sangu
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-03-17 07:34:16 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description sangu 2005-03-16 10:02:07 EST
Description of problem:
using $RPM_OPT_FLAGS, can't build emacs cvs

CFLAGS=-DMAIL_USE_LOCKF -O2 -Wall -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -m32
-march=athlon

$rpmbuild -ba --target=athlon emacs.spec
[...]
gcc -D_BSD_SOURCE -DHAVE_CONFIG_H -I. -I../src
-I/usr/src/redhat/BUILD/emacs-22.0.50/lib-src
-I/usr/src/redhat/BUILD/emacs-22.0.50/lib-src/../src -Wl,-znocombreloc
-L/usr/X11R6/lib -D_BSD_SOURCE   -DMAIL_USE_LOCKF -O2 -Wall -g -pipe
-Wp,-D_FORTIFY_SOURCE=2 -m32 -march=athlon
/usr/src/redhat/BUILD/emacs-22.0.50/lib-src/emacsclient.c getopt.o getopt1.o
-DVERSION="\"22.0.50\"" -lc -o emacsclient
/usr/src/redhat/BUILD/emacs-22.0.50/lib-src/emacsclient.c:45:15: error: macro
"getcwd" requires 2 arguments, but only 1 given
/usr/src/redhat/BUILD/emacs-22.0.50/lib-src/emacsclient.c:45: error: 'getcwd'
redeclared as different kind of symbol
/usr/include/unistd.h:449: error: previous declaration of 'getcwd' was here
/usr/src/redhat/BUILD/emacs-22.0.50/lib-src/emacsclient.c: In function 'main':
/usr/src/redhat/BUILD/emacs-22.0.50/lib-src/emacsclient.c:458: error: called
object 'getcwd' is not a function
make[1]: *** [emacsclient] Error 1
make[1]: Leaving directory `/usr/src/redhat/BUILD/emacs-22.0.50/lib-src'
make: *** [lib-src] Error 2

But in emacs-22.0.50/lib-src/Makefile
Changed to CFLAGS=-O2 -g (like to make bootstrap)

no errors



Version-Release number of selected component (if applicable):
gcc-4.0.0-0.34

How reproducible:
always

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
glibc-2.3.4-14, emacs cvs 20050317
Comment 1 sangu 2005-03-16 10:12:33 EST
The same problem happens in emacs-21.3-25.src.rpm, too.
Comment 2 Jakub Jelinek 2005-03-17 07:34:16 EST
That's a bug in emacs.  POSIX allows getcwd (actually, most of its functions)
to be also defined as function-like macros.
If emacs wants to use getcwd for something else, it should either #undef getcwd
first or prevent its expansion as function-like macro (e.g. using (getcwd) (...)
instead of getcwd (...)).

Note You need to log in before you can comment on or make changes to this bug.