Closed Bug 824460 Opened 7 years ago Closed 7 years ago

clang/libc++ build fails in netwerk/ipc/RemoteOpenFileParent.cpp

Categories

(Core :: Networking: JAR, defect)

x86_64
FreeBSD
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla20
Tracking Status
firefox19 --- fixed
firefox20 --- fixed
b2g18 --- fixed

People

(Reporter: jbeich, Assigned: jbeich)

References

Details

Attachments

(1 file)

To build with libc++ add -stdlib=libc++ to CXXFLAGS.

netwerk/ipc/RemoteOpenFileParent.cpp:32:5: error:
      use of undeclared identifier 'close'
    close(mFd);
    ^
1 error generated.
Attachment #695456 - Flags: review?(jduell.mcbugs)
Comment on attachment 695456 [details] [diff] [review]
add missing include from close(2) manpage

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

Thanks for fixing this--for some reason the version of clang on my mac didn't need the extra #include.

I assume we don't need the CXXFLAGS fix mentioned in comment 0, just the #include, right?

This should land on aurora/b2g18--else we'll break those trees for clang.
Attachment #695456 - Flags: review?(jduell.mcbugs)
Attachment #695456 - Flags: review+
Attachment #695456 - Flags: approval-mozilla-b2g18?
Attachment #695456 - Flags: approval-mozilla-aurora?
(In reply to Jason Duell (:jduell) from comment #2)
> Thanks for fixing this--for some reason the version of clang on my mac
> didn't need the extra #include.

I have no clue where OS X stands but FreeBSD certainly moves towards having libc++ used/linked by default. At the moment FreeBSD 10 still uses old libstdc++ (still under GPLv2) by default but you only need to add -stdlib=libc++ to CXXFLAGS to use libc++.

http://wiki.freebsd.org/NewC%2B%2BStack
http://lists.freebsd.org/pipermail/freebsd-toolchain/2012-September/000558.html
http://svnweb.freebsd.org/base?view=revision&revision=240966 # libc++ is built by default with clang
http://svnweb.freebsd.org/base?view=revision&revision=242624 # clang became default in FreeBSD 10

> 
> I assume we don't need the CXXFLAGS fix mentioned in comment 0, just the
> #include, right?

Just the include. clang/libc++ is one receipt to reproduce the error. Another is probably using more recent gcc/libstdc++ e.g.,

netwerk/ipc/RemoteOpenFileParent.cpp: In destructor 'virtual mozilla::net::RemoteOpenFileParent::~RemoteOpenFileParent()':
netwerk/ipc/RemoteOpenFileParent.cpp:33:14: error: 'close' was not declared in this scope

> 
> This should land on aurora/b2g18--else we'll break those trees for clang.

Thanks. I need it on Aurora to have one patch less in FreeBSD ports tree when firefox 19.0 is released.
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/6b81175079c5
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Comment on attachment 695456 [details] [diff] [review]
add missing include from close(2) manpage

Approving as the patch just involves adding the missing #include & will help avoid breaking those(aurora/b2g18) trees
Attachment #695456 - Flags: approval-mozilla-b2g18?
Attachment #695456 - Flags: approval-mozilla-b2g18+
Attachment #695456 - Flags: approval-mozilla-aurora?
Attachment #695456 - Flags: approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.