Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use real filename instead of __FILE__ #10895

Merged
merged 1 commit into from
Jun 2, 2024
Merged

Conversation

fd00
Copy link
Contributor

@fd00 fd00 commented Jun 2, 2024

Compilation fails when srcdir ! = builddir and -ffile-prefix-map option is specified.

$ cd /home/xxx/src # HOME=/home/xxx
$ git clone https://github.com/ruby/ruby
$ cd ruby
$ ./autogen.sh
$ cd /tmp && mkdir ruby && cd ruby
$ CFLAGS=-ffile-prefix-map=${HOME}/src/ruby=/usr/src/debug/ruby ${HOME}/src/ruby/configure
$ make V=1
:
gcc -ffile-prefix-map=/home/xxx/src/ruby=/usr/src/debug/ruby  -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -fvisibility=hidden -fexcess-precision=standard -DRUBY_EXPORT -fPIE -I. -I.ext/include/x86_64-linux -I/home/xxx/src/ruby/include -I/home/xxx/src/ruby -I/home/xxx/src/ruby/prism -I/home/xxx/src/ruby/enc/unicode/15.0.0      -o array.o -c /home/xxx/src/ruby/array.c
In file included from /home/xxx/src/ruby/array.c:14:
/home/xxx/src/ruby/debug_counter.h:359:10: fatal error: /usr/src/debug/ruby/debug_counter.h: No such file or directory
  359 | #include __FILE__
      |          ^~~~~~~~
compilation terminated.
make: *** [Makefile:450: array.o] Error 1

This commit reverts 1fd1fb2

@nobu nobu enabled auto-merge (rebase) June 2, 2024 12:32
@nobu nobu merged commit e1c9e62 into ruby:master Jun 2, 2024
100 checks passed
@fd00 fd00 deleted the use-real-filename branch June 2, 2024 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants