Last Comment Bug 752313 - gcc LTO compilation error in crashreporter_gtk_common.cpp
: gcc LTO compilation error in crashreporter_gtk_common.cpp
Status: RESOLVED FIXED
:
Product: Toolkit
Classification: Components
Component: Breakpad Integration (show other bugs)
: Trunk
: x86_64 Linux
: -- normal (vote)
: mozilla18
Assigned To: Arnaud Sourioux [:Six]
:
: Ted Mielczarek [:ted.mielczarek]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-06 07:05 PDT by Martin Liška
Modified: 2012-09-10 18:42 PDT (History)
4 users (show)
ryanvm: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
add #include <unistd.h> to crashreporter_gtk_common.cpp (783 bytes, patch)
2012-09-10 07:12 PDT, Arnaud Sourioux [:Six]
no flags Details | Diff | Splinter Review
add #include <unistd.h> to crashreporter_gtk_common.cpp to fix Linux x86_64 build issue (1.08 KB, patch)
2012-09-10 13:55 PDT, Arnaud Sourioux [:Six]
ted: review+
Details | Diff | Splinter Review

Description Martin Liška 2012-05-06 07:05:58 PDT
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.15 Safari/536.5

Steps to reproduce:

.mozconfig:

mk_add_options MOZ_MAKE_FLAGS=-j16
ac_add_options --enable-application=browser                                     
ac_add_options --enable-libxul                                                  
ac_add_options --enable-optimize                                                
ac_add_options --disable-tests     
ac_add_options --disable-libjpeg-turbo
ac_add_options --disable-necko-wifi

CXX=/aux/marxin/gcc/gcc-bin/bin_install/usr/local/bin/g++ -fuse-linker-plugin  -fpermissive -static-libstdc++
CC=/aux/marxin/gcc/gcc-bin/bin_install/usr/local/bin/gcc -flto -fuse-linker-plugin

Fix hint:
adding #include <unistd.h> in the problematic file?




Actual results:

/aux/marxin/mozilla/toolkit/crashreporter/client/crashreporter_gtk_common.cpp: In function 'bool RestartApplication()':
/aux/marxin/mozilla/toolkit/crashreporter/client/crashreporter_gtk_common.cpp:106:20: error: 'fork' was not declared in this scope
   pid_t pid = fork();
                    ^
/aux/marxin/mozilla/toolkit/crashreporter/client/crashreporter_gtk_common.cpp:110:30: error: 'execv' was not declared in this scope
     (void)execv(argv[0], argv);
                              ^
/aux/marxin/mozilla/toolkit/crashreporter/client/crashreporter_gtk_common.cpp:111:12: error: '_exit' was not declared in this scope
     _exit(1);
            ^
/aux/marxin/mozilla/toolkit/crashreporter/client/crashreporter_gtk_common.cpp: In function 'bool UIMoveFile(const string&, const string&)':
/aux/marxin/mozilla/toolkit/crashreporter/client/crashreporter_gtk_common.cpp:423:21: error: 'vfork' was not declared in this scope
   pid_t pID = vfork();
                     ^
/aux/marxin/mozilla/toolkit/crashreporter/client/crashreporter_gtk_common.cpp:434:5: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
     };
     ^
/aux/marxin/mozilla/toolkit/crashreporter/client/crashreporter_gtk_common.cpp:436:32: error: 'execve' was not declared in this scope
       execve("/bin/mv", args, 0);
                                ^
/aux/marxin/mozilla/toolkit/crashreporter/client/crashreporter_gtk_common.cpp: In function 'bool UIDeleteFile(const string&)':
/aux/marxin/mozilla/toolkit/crashreporter/client/crashreporter_gtk_common.cpp:450:30: error: 'unlink' was not declared in this scope
   return (unlink(file.c_str()) != -1);
                              ^
/aux/marxin/mozilla/toolkit/crashreporter/client/crashreporter_gtk_common.cpp:451:1: error: control reaches end of non-void function [-Werror=return-type]
 }
Comment 1 Arnaud Sourioux [:Six] 2012-09-10 07:12:12 PDT
Created attachment 659701 [details] [diff] [review]
add #include <unistd.h> to crashreporter_gtk_common.cpp
Comment 2 Arnaud Sourioux [:Six] 2012-09-10 07:14:50 PDT
I'm having the same issue :

$>cat .mozconfig
mk_add_options MOZ_MAKE_FLAGS="CC='gcc' CXX='g++ -std=c++11' -j4"
ac_add_options --enable-debug

gcc version 4.7.1 (Debian 4.7.1-7)
on Debian 2.6.32-5-amd64
Comment 3 Arnaud Sourioux [:Six] 2012-09-10 13:55:04 PDT
Created attachment 659849 [details] [diff] [review]
add #include <unistd.h> to crashreporter_gtk_common.cpp to fix Linux x86_64 build issue
Comment 4 Ted Mielczarek [:ted.mielczarek] 2012-09-10 16:57:02 PDT
Comment on attachment 659849 [details] [diff] [review]
add #include <unistd.h> to crashreporter_gtk_common.cpp to fix Linux x86_64 build issue

Review of attachment 659849 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for the patch!
Comment 5 Ryan VanderMeulen [:RyanVM] 2012-09-10 17:09:02 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/96287ad60bef
Comment 6 Ryan VanderMeulen [:RyanVM] 2012-09-10 18:42:31 PDT
https://hg.mozilla.org/mozilla-central/rev/96287ad60bef

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