Prompt AOSP 2.3.7 compilation error

Please help. I am getting the error when i compile 2.3.7 from source for my p500

Code:
In file included from device/lge/p500/libaudio/AudioHardware.cpp:36:
frameworks/base/include/media/AudioRecord.h:145: error: expected unqualified-id before numeric constant
frameworks/base/include/media/AudioRecord.h:145: error: expected '}' before numeric constant
frameworks/base/include/media/AudioRecord.h:145: error: expected unqualified-id before numeric constant
frameworks/base/include/media/AudioRecord.h:150: error: expected unqualified-id before 'int'
frameworks/base/include/media/AudioRecord.h:150: error: expected ')' before 'int'
frameworks/base/include/media/AudioRecord.h:165: error: expected constructor, destructor, or type conversion before ';' token
frameworks/base/include/media/AudioRecord.h:182: error: 'callback_t' has not been declared
frameworks/base/include/media/AudioRecord.h:194: error: non-member function 'android::status_t android::initCheck()' cannot have cv-qualifier
frameworks/base/include/media/AudioRecord.h:200: error: non-member function 'uint32_t android::latency()' cannot have cv-qualifier
frameworks/base/include/media/AudioRecord.h:204: error: non-member function 'int android::format()' cannot have cv-qualifier
frameworks/base/include/media/AudioRecord.h:205: error: non-member function 'int android::channelCount()' cannot have cv-qualifier
frameworks/base/include/media/AudioRecord.h:206: error: non-member function 'int android::channels()' cannot have cv-qualifier
frameworks/base/include/media/AudioRecord.h:207: error: non-member function 'uint32_t android::frameCount()' cannot have cv-qualifier
frameworks/base/include/media/AudioRecord.h:208: error: non-member function 'int android::frameSize()' cannot have cv-qualifier
frameworks/base/include/media/AudioRecord.h:209: error: non-member function 'int android::inputSource()' cannot have cv-qualifier
frameworks/base/include/media/AudioRecord.h:222: error: non-member function 'bool android::stopped()' cannot have cv-qualifier
frameworks/base/include/media/AudioRecord.h:313: error: 'Buffer' was not declared in this scope
frameworks/base/include/media/AudioRecord.h:313: error: 'audioBuffer' was not declared in this scope
frameworks/base/include/media/AudioRecord.h:313: error: expected primary-expression before 'waitCount'
frameworks/base/include/media/AudioRecord.h:313: error: initializer expression list treated as compound expression
frameworks/base/include/media/AudioRecord.h:314: error: variable or field 'releaseBuffer' declared void
frameworks/base/include/media/AudioRecord.h:314: error: 'Buffer' was not declared in this scope
frameworks/base/include/media/AudioRecord.h:314: error: 'audioBuffer' was not declared in this scope
In file included from device/lge/p500/libaudio/AudioHardware.cpp:36:
frameworks/base/include/media/AudioRecord.h:329: error: expected unqualified-id before 'private'
frameworks/base/include/media/AudioRecord.h:332: error: 'android::AudioRecord& android::operator=(const android::AudioRecord&)' must be a nonstatic member function
frameworks/base/include/media/AudioRecord.h:373: error: 'callback_t' does not name a type
frameworks/base/include/media/AudioRecord.h:387: error: expected declaration before '}' token
make: *** [out/target/product/p500/obj/SHARED_LIBRARIES/libaudio_intermediates/AudioHardware.o] Error 1
make: *** Waiting for unfinished jobs....
anthony@android-build-server:~/aosp$
Please help
My devices

LG Optimus T Burgundy
ROM -> Stock 2.2 Unbranded
Recovery -> TWRP 2.6.3.0
Rooted
Unlocked

Amazon Kindle Fire
ROM -> AOSP 4.3.1 by Hashcode
Bootloader -> Fire Fire Fire 1.4a
Recovery -> TWRP 2.6.3.1
Rooted