Bug 151260 - using $RPM_OPT_FLAGS, can't build emacs cvs
Summary: using $RPM_OPT_FLAGS, can't build emacs cvs
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: emacs
Version: rawhide
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-03-16 15:02 UTC by sangu
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2005-03-17 12:34:16 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description sangu 2005-03-16 15:02:07 UTC
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 15:12:33 UTC
The same problem happens in emacs-21.3-25.src.rpm, too.

Comment 2 Jakub Jelinek 2005-03-17 12:34:16 UTC
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.